添加新文件
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// 激活部分的颜色
|
||||
activeColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.lineProgress.activeColor
|
||||
},
|
||||
inactiveColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.lineProgress.color
|
||||
},
|
||||
// 进度百分比,数值
|
||||
percentage: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.lineProgress.inactiveColor
|
||||
},
|
||||
// 是否在进度条内部显示百分比的值
|
||||
showText: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.lineProgress.showText
|
||||
},
|
||||
// 进度条的高度,单位px
|
||||
height: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.defProps.lineProgress.height
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-line-progress/props.js.map
|
||||
Vendored
+72
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uLineProgress_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-line-progress",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uLineProgress_props.props],
|
||||
data() {
|
||||
return {
|
||||
lineWidth: 0
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
percentage(n) {
|
||||
this.resizeProgressWidth();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
progressStyle() {
|
||||
let style = {};
|
||||
style.width = this.lineWidth;
|
||||
style.backgroundColor = this.activeColor;
|
||||
style.height = uni_modules_uviewPlus_libs_function_index.addUnit(this.height);
|
||||
return style;
|
||||
},
|
||||
innserPercentage() {
|
||||
return uni_modules_uviewPlus_libs_function_index.range(0, 100, this.percentage);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
|
||||
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
|
||||
init() {
|
||||
uni_modules_uviewPlus_libs_function_index.sleep(20).then(() => {
|
||||
this.resizeProgressWidth();
|
||||
});
|
||||
},
|
||||
getProgressWidth() {
|
||||
return this.$uGetRect(".u-line-progress__background");
|
||||
},
|
||||
resizeProgressWidth() {
|
||||
this.getProgressWidth().then((size) => {
|
||||
const {
|
||||
width
|
||||
} = size;
|
||||
this.lineWidth = width * this.innserPercentage / 100 + "px";
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.s({
|
||||
backgroundColor: _ctx.inactiveColor,
|
||||
height: $options.addUnit(_ctx.height)
|
||||
}),
|
||||
b: _ctx.showText && _ctx.percentage >= 10
|
||||
}, _ctx.showText && _ctx.percentage >= 10 ? {
|
||||
c: common_vendor.t($options.innserPercentage + "%")
|
||||
} : {}, {
|
||||
d: common_vendor.s($options.progressStyle),
|
||||
e: common_vendor.s($options.addStyle(_ctx.customStyle))
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-eeee7090"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-line-progress/u-line-progress.js.map
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
<view class="u-line-progress data-v-eeee7090" style="{{e}}"><view class="u-line-progress__background data-v-eeee7090" ref="u-line-progress__background" style="{{a}}"></view><view class="u-line-progress__line data-v-eeee7090" style="{{d}}"><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else><text wx:if="{{b}}" class="u-line-progress__text data-v-eeee7090">{{c}}</text></block></view></view>
|
||||
Vendored
+83
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/* uni.scss */
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
.u-empty.data-v-eeee7090,
|
||||
.u-empty__wrap.data-v-eeee7090,
|
||||
.u-tabs.data-v-eeee7090,
|
||||
.u-tabs__wrapper.data-v-eeee7090,
|
||||
.u-tabs__wrapper__scroll-view-wrapper.data-v-eeee7090,
|
||||
.u-tabs__wrapper__scroll-view.data-v-eeee7090,
|
||||
.u-tabs__wrapper__nav.data-v-eeee7090,
|
||||
.u-tabs__wrapper__nav__line.data-v-eeee7090,
|
||||
.up-empty.data-v-eeee7090,
|
||||
.up-empty__wrap.data-v-eeee7090,
|
||||
.up-tabs.data-v-eeee7090,
|
||||
.up-tabs__wrapper.data-v-eeee7090,
|
||||
.up-tabs__wrapper__scroll-view-wrapper.data-v-eeee7090,
|
||||
.up-tabs__wrapper__scroll-view.data-v-eeee7090,
|
||||
.up-tabs__wrapper__nav.data-v-eeee7090,
|
||||
.up-tabs__wrapper__nav__line.data-v-eeee7090 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-shrink: 0;
|
||||
flex-grow: 0;
|
||||
flex-basis: auto;
|
||||
align-items: stretch;
|
||||
align-content: flex-start;
|
||||
}
|
||||
.u-line-progress.data-v-eeee7090 {
|
||||
align-items: stretch;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
border-radius: 100px;
|
||||
}
|
||||
.u-line-progress__background.data-v-eeee7090 {
|
||||
background-color: #ececec;
|
||||
border-radius: 100px;
|
||||
flex: 1;
|
||||
}
|
||||
.u-line-progress__line.data-v-eeee7090 {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
color: #ffffff;
|
||||
border-radius: 100px;
|
||||
transition: width 0.5s ease;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.u-line-progress__text.data-v-eeee7090 {
|
||||
font-size: 10px;
|
||||
align-items: center;
|
||||
text-align: right;
|
||||
color: #FFFFFF;
|
||||
margin-right: 5px;
|
||||
transform: scale(0.9);
|
||||
}
|
||||
Reference in New Issue
Block a user