mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
fix: stepper doc (#222)
This commit is contained in:
parent
49db8e944f
commit
fd77f4736d
@ -18,10 +18,14 @@ Page(Object.assign({}, {
|
||||
}
|
||||
},
|
||||
|
||||
handleZanStepperChange(e) {
|
||||
const componentId = e.target.dataset.componentId;
|
||||
const stepper = e.detail;
|
||||
|
||||
handleZanStepperChange({
|
||||
detail: stepper,
|
||||
target: {
|
||||
dataset: {
|
||||
componentId
|
||||
}
|
||||
}
|
||||
}) {
|
||||
this.setData({
|
||||
[`${componentId}.stepper`]: stepper
|
||||
});
|
||||
|
@ -27,12 +27,20 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
handleZanStepperChange({ componentId, stepper }) {
|
||||
// componentId 即为在模板中传入的 componentId
|
||||
// 用于在一个页面上使用多个 stepper 时,进行区分
|
||||
handleZanStepperChange({
|
||||
|
||||
// stepper 代表操作后,应该要展示的数字,需要设置到数据对象里,才会更新页面展示
|
||||
detail: stepper,
|
||||
|
||||
// 模板中传入的 componentId,用于区分一个页面上的多个stepper
|
||||
target: {
|
||||
dataset: {
|
||||
componentId
|
||||
}
|
||||
}
|
||||
}) {
|
||||
this.setData({
|
||||
stepper
|
||||
[`${componentId}.stepper`]: stepper
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user