mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
fix(Notify & Slider): fix eslint error (#2702)
This commit is contained in:
parent
8571a6e67e
commit
358beafbde
@ -39,7 +39,7 @@ function getContext() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function Notify(options: NotifyOptions | string) {
|
export default function Notify(options: NotifyOptions | string) {
|
||||||
options = Object.assign({}, defaultOptions, parseOptions(options));
|
options = { ...defaultOptions, ...parseOptions(options) } as NotifyOptions;
|
||||||
|
|
||||||
const context = options.context || getContext();
|
const context = options.context || getContext();
|
||||||
const notify = context.selectComponent(options.selector);
|
const notify = context.selectComponent(options.selector);
|
||||||
@ -57,7 +57,7 @@ export default function Notify(options: NotifyOptions | string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Notify.clear = function(options?: NotifyOptions) {
|
Notify.clear = function(options?: NotifyOptions) {
|
||||||
options = Object.assign({}, defaultOptions, parseOptions(options));
|
options = { ...defaultOptions, ...parseOptions(options) } as NotifyOptions;
|
||||||
|
|
||||||
const context = options.context || getContext();
|
const context = options.context || getContext();
|
||||||
const notify = context.selectComponent(options.selector);
|
const notify = context.selectComponent(options.selector);
|
||||||
|
@ -60,7 +60,7 @@ VantComponent({
|
|||||||
this.dragStatus = 'draging';
|
this.dragStatus = 'draging';
|
||||||
|
|
||||||
this.getRect('.van-slider').then((rect: WechatMiniprogram.BoundingClientRectCallbackResult) => {
|
this.getRect('.van-slider').then((rect: WechatMiniprogram.BoundingClientRectCallbackResult) => {
|
||||||
const diff = this.deltaX / rect.width * 100;
|
const diff = (this.deltaX / rect.width) * 100;
|
||||||
this.newValue = this.startValue + diff;
|
this.newValue = this.startValue + diff;
|
||||||
this.updateValue(this.newValue, false, true);
|
this.updateValue(this.newValue, false, true);
|
||||||
});
|
});
|
||||||
@ -81,7 +81,7 @@ VantComponent({
|
|||||||
const { min } = this.data;
|
const { min } = this.data;
|
||||||
|
|
||||||
this.getRect('.van-slider').then((rect: WechatMiniprogram.BoundingClientRectCallbackResult) => {
|
this.getRect('.van-slider').then((rect: WechatMiniprogram.BoundingClientRectCallbackResult) => {
|
||||||
const value = (event.detail.x - rect.left) / rect.width * this.getRange() + min;
|
const value = ((event.detail.x - rect.left) / rect.width) * this.getRange() + min;
|
||||||
this.updateValue(value, true);
|
this.updateValue(value, true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user