first
This commit is contained in:
1
node_modules/vant/lib/progress/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/progress/index.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
.van-progress{position:relative;height:4px;background:#ebedf0;border-radius:4px}.van-progress__portion{position:absolute;left:0;height:100%;background:#1989fa;border-radius:inherit}.van-progress__pivot{position:absolute;top:50%;box-sizing:border-box;min-width:3.6em;padding:0 5px;color:#fff;font-size:10px;line-height:1.6;text-align:center;word-break:keep-all;background-color:#1989fa;border-radius:1em;-webkit-transform:translate(0,-50%);transform:translate(0,-50%)}
|
97
node_modules/vant/lib/progress/index.js
generated
vendored
Normal file
97
node_modules/vant/lib/progress/index.js
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _utils = require("../utils");
|
||||
|
||||
var _bindEvent = require("../mixins/bind-event");
|
||||
|
||||
var _createNamespace = (0, _utils.createNamespace)('progress'),
|
||||
createComponent = _createNamespace[0],
|
||||
bem = _createNamespace[1];
|
||||
|
||||
var _default = createComponent({
|
||||
mixins: [(0, _bindEvent.BindEventMixin)(function (bind) {
|
||||
bind(window, 'resize', this.resize, true);
|
||||
bind(window, 'orientationchange', this.resize, true);
|
||||
})],
|
||||
props: {
|
||||
color: String,
|
||||
inactive: Boolean,
|
||||
pivotText: String,
|
||||
textColor: String,
|
||||
pivotColor: String,
|
||||
trackColor: String,
|
||||
strokeWidth: [Number, String],
|
||||
percentage: {
|
||||
type: [Number, String],
|
||||
required: true,
|
||||
validator: function validator(value) {
|
||||
return value >= 0 && value <= 100;
|
||||
}
|
||||
},
|
||||
showPivot: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data: function data() {
|
||||
return {
|
||||
pivotWidth: 0,
|
||||
progressWidth: 0
|
||||
};
|
||||
},
|
||||
mounted: function mounted() {
|
||||
this.resize();
|
||||
},
|
||||
watch: {
|
||||
showPivot: 'resize',
|
||||
pivotText: 'resize'
|
||||
},
|
||||
methods: {
|
||||
// @exposed-api
|
||||
resize: function resize() {
|
||||
var _this = this;
|
||||
|
||||
this.$nextTick(function () {
|
||||
_this.progressWidth = _this.$el.offsetWidth;
|
||||
_this.pivotWidth = _this.$refs.pivot ? _this.$refs.pivot.offsetWidth : 0;
|
||||
});
|
||||
}
|
||||
},
|
||||
render: function render() {
|
||||
var h = arguments[0];
|
||||
var pivotText = this.pivotText,
|
||||
percentage = this.percentage;
|
||||
var text = pivotText != null ? pivotText : percentage + '%';
|
||||
var showPivot = this.showPivot && text;
|
||||
var background = this.inactive ? '#cacaca' : this.color;
|
||||
var pivotStyle = {
|
||||
color: this.textColor,
|
||||
left: (this.progressWidth - this.pivotWidth) * percentage / 100 + "px",
|
||||
background: this.pivotColor || background
|
||||
};
|
||||
var portionStyle = {
|
||||
background: background,
|
||||
width: this.progressWidth * percentage / 100 + 'px'
|
||||
};
|
||||
var wrapperStyle = {
|
||||
background: this.trackColor,
|
||||
height: (0, _utils.addUnit)(this.strokeWidth)
|
||||
};
|
||||
return h("div", {
|
||||
"class": bem(),
|
||||
"style": wrapperStyle
|
||||
}, [h("span", {
|
||||
"class": bem('portion'),
|
||||
"style": portionStyle
|
||||
}, [showPivot && h("span", {
|
||||
"ref": "pivot",
|
||||
"style": pivotStyle,
|
||||
"class": bem('pivot')
|
||||
}, [text])])]);
|
||||
}
|
||||
});
|
||||
|
||||
exports.default = _default;
|
32
node_modules/vant/lib/progress/index.less
generated
vendored
Normal file
32
node_modules/vant/lib/progress/index.less
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
@import '../style/var';
|
||||
|
||||
.van-progress {
|
||||
position: relative;
|
||||
height: @progress-height;
|
||||
background: @progress-background-color;
|
||||
border-radius: @progress-height;
|
||||
|
||||
&__portion {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
background: @progress-color;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
&__pivot {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
box-sizing: border-box;
|
||||
min-width: 3.6em;
|
||||
padding: @progress-pivot-padding;
|
||||
color: @progress-pivot-text-color;
|
||||
font-size: @progress-pivot-font-size;
|
||||
line-height: @progress-pivot-line-height;
|
||||
text-align: center;
|
||||
word-break: keep-all;
|
||||
background-color: @progress-pivot-background-color;
|
||||
border-radius: 1em;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
}
|
2
node_modules/vant/lib/progress/style/index.js
generated
vendored
Normal file
2
node_modules/vant/lib/progress/style/index.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
require('../../style/base.css');
|
||||
require('../index.css');
|
2
node_modules/vant/lib/progress/style/less.js
generated
vendored
Normal file
2
node_modules/vant/lib/progress/style/less.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
require('../../style/base.less');
|
||||
require('../index.less');
|
Reference in New Issue
Block a user