build: compile 1.8.1

This commit is contained in:
chenjiahan 2021-08-18 10:50:37 +08:00
parent 41457c899b
commit abad857155
13 changed files with 55 additions and 37 deletions

View File

@ -5,6 +5,7 @@
subtitle="{{ subtitle }}" subtitle="{{ subtitle }}"
showSubtitle="{{ showSubtitle }}" showSubtitle="{{ showSubtitle }}"
firstDayOfWeek="{{ firstDayOfWeek }}" firstDayOfWeek="{{ firstDayOfWeek }}"
bind:click-subtitle="onClickSubtitle"
> >
<slot name="title" slot="title"></slot> <slot name="title" slot="title"></slot>
</header> </header>

View File

@ -30,5 +30,8 @@ VantComponent({
], ],
}); });
}, },
onClickSubtitle(event) {
this.$emit('click-subtitle', event);
},
}, },
}); });

View File

@ -4,7 +4,7 @@
<view class="van-calendar__header-title">{{ title }}</view> <view class="van-calendar__header-title">{{ title }}</view>
</block> </block>
<view wx:if="{{ showSubtitle }}" class="van-calendar__header-subtitle"> <view wx:if="{{ showSubtitle }}" class="van-calendar__header-subtitle" bind:tap="onClickSubtitle">
{{ subtitle }} {{ subtitle }}
</view> </view>

View File

@ -339,5 +339,8 @@ VantComponent({
this.$emit('confirm', copyDates(this.data.currentDate)); this.$emit('confirm', copyDates(this.data.currentDate));
}); });
}, },
onClickSubtitle(event) {
this.$emit('click-subtitle', event);
},
}, },
}); });

32
dist/circle/index.js vendored
View File

@ -152,28 +152,30 @@ VantComponent({
this.drawCircle(value); this.drawCircle(value);
return; return;
} }
this.clearInterval(); this.clearMockInterval();
this.currentValue = this.currentValue || 0; this.currentValue = this.currentValue || 0;
this.interval = setInterval(() => { const run = () => {
if (this.currentValue !== value) { this.interval = setTimeout(() => {
if (Math.abs(this.currentValue - value) < STEP) { if (this.currentValue !== value) {
this.currentValue = value; if (Math.abs(this.currentValue - value) < STEP) {
} else { this.currentValue = value;
if (this.currentValue < value) { } else if (this.currentValue < value) {
this.currentValue += STEP; this.currentValue += STEP;
} else { } else {
this.currentValue -= STEP; this.currentValue -= STEP;
} }
this.drawCircle(this.currentValue);
run();
} else {
this.clearMockInterval();
} }
this.drawCircle(this.currentValue); }, 1000 / speed);
} else { };
this.clearInterval(); run();
}
}, 1000 / speed);
}, },
clearInterval() { clearMockInterval() {
if (this.interval) { if (this.interval) {
clearInterval(this.interval); clearTimeout(this.interval);
this.interval = null; this.interval = null;
} }
}, },
@ -185,6 +187,6 @@ VantComponent({
}); });
}, },
destroyed() { destroyed() {
this.clearInterval(); this.clearMockInterval();
}, },
}); });

View File

@ -1,7 +1,7 @@
<wxs src="./index.wxs" module="computed" /> <wxs src="./index.wxs" module="computed" />
<view class="van-picker custom-class"> <view class="van-picker custom-class">
<include wx:if="{{ toolbarPosition === 'top' }}" src="toolbar.wxml" /> <include wx:if="{{ toolbarPosition === 'top' }}" src="./toolbar.wxml" />
<view wx:if="{{ loading }}" class="van-picker__loading"> <view wx:if="{{ loading }}" class="van-picker__loading">
<loading color="#1989fa"/> <loading color="#1989fa"/>
@ -33,5 +33,5 @@
/> />
</view> </view>
<include wx:if="{{ toolbarPosition === 'bottom' }}" src="toolbar.wxml" /> <include wx:if="{{ toolbarPosition === 'bottom' }}" src="./toolbar.wxml" />
</view> </view>

View File

@ -74,7 +74,7 @@ VantComponent({
onClear(event) { onClear(event) {
this.$emit('clear', event.detail); this.$emit('clear', event.detail);
}, },
onClickInput: function (event) { onClickInput(event) {
this.$emit('click-input', event.detail); this.$emit('click-input', event.detail);
}, },
}, },

View File

@ -5,6 +5,7 @@
subtitle="{{ subtitle }}" subtitle="{{ subtitle }}"
showSubtitle="{{ showSubtitle }}" showSubtitle="{{ showSubtitle }}"
firstDayOfWeek="{{ firstDayOfWeek }}" firstDayOfWeek="{{ firstDayOfWeek }}"
bind:click-subtitle="onClickSubtitle"
> >
<slot name="title" slot="title"></slot> <slot name="title" slot="title"></slot>
</header> </header>

View File

@ -39,5 +39,8 @@ component_1.VantComponent({
), ),
}); });
}, },
onClickSubtitle: function (event) {
this.$emit('click-subtitle', event);
},
}, },
}); });

View File

@ -4,7 +4,7 @@
<view class="van-calendar__header-title">{{ title }}</view> <view class="van-calendar__header-title">{{ title }}</view>
</block> </block>
<view wx:if="{{ showSubtitle }}" class="van-calendar__header-subtitle"> <view wx:if="{{ showSubtitle }}" class="van-calendar__header-subtitle" bind:tap="onClickSubtitle">
{{ subtitle }} {{ subtitle }}
</view> </view>

View File

@ -375,5 +375,8 @@ component_1.VantComponent({
_this.$emit('confirm', utils_1.copyDates(_this.data.currentDate)); _this.$emit('confirm', utils_1.copyDates(_this.data.currentDate));
}); });
}, },
onClickSubtitle: function (event) {
this.$emit('click-subtitle', event);
},
}, },
}); });

View File

@ -176,28 +176,30 @@ component_1.VantComponent({
this.drawCircle(value); this.drawCircle(value);
return; return;
} }
this.clearInterval(); this.clearMockInterval();
this.currentValue = this.currentValue || 0; this.currentValue = this.currentValue || 0;
this.interval = setInterval(function () { var run = function () {
if (_this.currentValue !== value) { _this.interval = setTimeout(function () {
if (Math.abs(_this.currentValue - value) < STEP) { if (_this.currentValue !== value) {
_this.currentValue = value; if (Math.abs(_this.currentValue - value) < STEP) {
} else { _this.currentValue = value;
if (_this.currentValue < value) { } else if (_this.currentValue < value) {
_this.currentValue += STEP; _this.currentValue += STEP;
} else { } else {
_this.currentValue -= STEP; _this.currentValue -= STEP;
} }
_this.drawCircle(_this.currentValue);
run();
} else {
_this.clearMockInterval();
} }
_this.drawCircle(_this.currentValue); }, 1000 / speed);
} else { };
_this.clearInterval(); run();
}
}, 1000 / speed);
}, },
clearInterval: function () { clearMockInterval: function () {
if (this.interval) { if (this.interval) {
clearInterval(this.interval); clearTimeout(this.interval);
this.interval = null; this.interval = null;
} }
}, },
@ -210,6 +212,6 @@ component_1.VantComponent({
}); });
}, },
destroyed: function () { destroyed: function () {
this.clearInterval(); this.clearMockInterval();
}, },
}); });

View File

@ -1,7 +1,7 @@
<wxs src="./index.wxs" module="computed" /> <wxs src="./index.wxs" module="computed" />
<view class="van-picker custom-class"> <view class="van-picker custom-class">
<include wx:if="{{ toolbarPosition === 'top' }}" src="toolbar.wxml" /> <include wx:if="{{ toolbarPosition === 'top' }}" src="./toolbar.wxml" />
<view wx:if="{{ loading }}" class="van-picker__loading"> <view wx:if="{{ loading }}" class="van-picker__loading">
<loading color="#1989fa"/> <loading color="#1989fa"/>
@ -33,5 +33,5 @@
/> />
</view> </view>
<include wx:if="{{ toolbarPosition === 'bottom' }}" src="toolbar.wxml" /> <include wx:if="{{ toolbarPosition === 'bottom' }}" src="./toolbar.wxml" />
</view> </view>