diff --git a/packages/vant/src/date-picker/README.md b/packages/vant/src/date-picker/README.md index f3a2fe272..bba3ed9ad 100644 --- a/packages/vant/src/date-picker/README.md +++ b/packages/vant/src/date-picker/README.md @@ -188,9 +188,9 @@ export default { | Event | Description | Arguments | | --- | --- | --- | -| confirm | Emitted when the confirm button is clicked | _{ selectedValues, selectedOptions }_ | -| cancel | Emitted when the cancel button is clicked | _{ selectedValues, selectedOptions }_ | -| change | Emitted when current option is changed | _{ selectedValues, selectedOptions, columnIndex }_ | +| confirm | Emitted when the confirm button is clicked | _{ selectedValues, selectedOptions, selectedIndexes }_ | +| cancel | Emitted when the cancel button is clicked | _{ selectedValues, selectedOptions, selectedIndexes }_ | +| change | Emitted when current option is changed | _{ selectedValues, selectedOptions, selectedIndexes, columnIndex }_ | ### Slots diff --git a/packages/vant/src/date-picker/README.zh-CN.md b/packages/vant/src/date-picker/README.zh-CN.md index 6c49e62b0..22859a506 100644 --- a/packages/vant/src/date-picker/README.zh-CN.md +++ b/packages/vant/src/date-picker/README.zh-CN.md @@ -194,9 +194,9 @@ export default { | 事件名 | 说明 | 回调参数 | | --- | --- | --- | -| confirm | 点击完成按钮时触发 | _{ selectedValues, selectedOptions }_ | -| cancel | 点击取消按钮时触发 | _{ selectedValues, selectedOptions }_ | -| change | 选项改变时触发 | _{ selectedValues, selectedOptions, columnIndex }_ | +| confirm | 点击完成按钮时触发 | _{ selectedValues, selectedOptions, selectedIndexes }_ | +| cancel | 点击取消按钮时触发 | _{ selectedValues, selectedOptions, selectedIndexes }_ | +| change | 选项改变时触发 | _{ selectedValues, selectedOptions, selectedIndexes, columnIndex }_ | ### Slots diff --git a/packages/vant/src/time-picker/README.md b/packages/vant/src/time-picker/README.md index f421f3f09..a7922074a 100644 --- a/packages/vant/src/time-picker/README.md +++ b/packages/vant/src/time-picker/README.md @@ -267,9 +267,9 @@ export default { | Event | Description | Arguments | | --- | --- | --- | -| confirm | Emitted when the confirm button is clicked | _{ selectedValues, selectedOptions }_ | -| cancel | Emitted when the cancel button is clicked | _{ selectedValues, selectedOptions }_ | -| change | Emitted when current option is changed | _{ selectedValues, selectedOptions, columnIndex }_ | +| confirm | Emitted when the confirm button is clicked | _{ selectedValues, selectedOptions, selectedIndexes }_ | +| cancel | Emitted when the cancel button is clicked | _{ selectedValues, selectedOptions, selectedIndexes }_ | +| change | Emitted when current option is changed | _{ selectedValues, selectedOptions, selectedIndexes, columnIndex }_ | ### Slots diff --git a/packages/vant/src/time-picker/README.zh-CN.md b/packages/vant/src/time-picker/README.zh-CN.md index 3983665ae..2f5edafdc 100644 --- a/packages/vant/src/time-picker/README.zh-CN.md +++ b/packages/vant/src/time-picker/README.zh-CN.md @@ -268,9 +268,9 @@ export default { | 事件名 | 说明 | 回调参数 | | --- | --- | --- | -| confirm | 点击完成按钮时触发 | _{ selectedValues, selectedOptions }_ | -| cancel | 点击取消按钮时触发 | _{ selectedValues, selectedOptions }_ | -| change | 选项改变时触发 | _{ selectedValues, selectedOptions, columnIndex }_ | +| confirm | 点击完成按钮时触发 | _{ selectedValues, selectedOptions, selectedIndexes }_ | +| cancel | 点击取消按钮时触发 | _{ selectedValues, selectedOptions, selectedIndexes }_ | +| change | 选项改变时触发 | _{ selectedValues, selectedOptions, selectedIndexes, columnIndex }_ | ### Slots diff --git a/packages/vant/src/time-picker/test/index.spec.tsx b/packages/vant/src/time-picker/test/index.spec.tsx index a84d7af3d..bbff4c48f 100644 --- a/packages/vant/src/time-picker/test/index.spec.tsx +++ b/packages/vant/src/time-picker/test/index.spec.tsx @@ -122,18 +122,18 @@ test('should filter options when using filter prop to filter a time range', asyn }); const picker = wrapper.findComponent(Picker); - let columns = picker.props('columns'); + let columns = picker.props('columns')!; expect(columns[0].length).toEqual(11); expect(columns[1].length).toEqual(20); expect(columns[0][0].value).toEqual('08'); expect(columns[1][0].value).toEqual('40'); await wrapper.setProps({ modelValue: ['09', '00'] }); - columns = picker.props('columns'); + columns = picker.props('columns')!; expect(columns[1].length).toEqual(60); await wrapper.setProps({ modelValue: ['18', '00'] }); - columns = picker.props('columns'); + columns = picker.props('columns')!; expect(columns[1].length).toEqual(21); expect(columns[1][20].value).toEqual('20'); });