miniprogram/miniprogram_npm/@vant/weapp/slider/index.js
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var component_1 = require("../common/component");
var touch_1 = require("../mixins/touch");
var version_1 = require("../common/version");
var utils_1 = require("../common/utils");
(0, component_1.VantComponent)({
mixins: [touch_1.touch],
props: {
range: Boolean,
disabled: Boolean,
useButtonSlot: Boolean,
activeColor: String,
inactiveColor: String,
max: {
type: Number,
value: 100,
},
min: {
type: Number,
value: 0,
},
step: {
type: Number,
value: 1,
},
value: {
type: null,
value: 0,
observer: function (val) {
if (val !== this.value) {
this.updateValue(val);
}
},
},
vertical: Boolean,
barHeight: null,
},
created: function () {
this.updateValue(this.data.value);
},
methods: {
onTouchStart: function (event) {
var _this = this;
if (this.data.disabled)
return;
var index = event.currentTarget.dataset.index;
if (typeof index === 'number') {
this.buttonIndex = index;
}
this.touchStart(event);
this.startValue = this.format(this.value);
this.newValue = this.value;
if (this.isRange(this.newValue)) {
this.startValue = this.newValue.map(function (val) { return _this.format(val); });
}
else {
this.startValue = this.format(this.newValue);
}
this.dragStatus = 'start';
后面还有 129 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
