diff --git a/docs/component/datetime-picker.md b/docs/component/datetime-picker.md index b6f366be..95154964 100644 --- a/docs/component/datetime-picker.md +++ b/docs/component/datetime-picker.md @@ -197,6 +197,10 @@ const filter = (type, values) => { 设置 `before-confirm` 函数,在用户点击`确定`按钮时,会执行 `before-confirm` 函数,并传入 `value`(time 类型为字符串,其他为时间戳,当picker为区间选择时,`value`为数组) 、 `resolve` 和 `picker` 参数,可以对 `value` 进行校验,并通过 `resolve` 函数告知组件是否确定通过,`resolve` 接受1个 boolean 值,`resolve(true)` 表示选项通过,`resolve(false)` 表示选项不通过,不通过时不会关闭 `picker`弹窗。可以通过 `picker` 参数直接设置 `loading` 等属性。 +:::tip 提示 +在调用 `resolve` 之前须确保 `picker` 参数 `loading` 的加载状态为 `false` ,否则无法正确触发组件的 `@confirm` 事件。 +::: + ```html diff --git a/docs/en-US/component/datetime-picker.md b/docs/en-US/component/datetime-picker.md index 1b715d18..51c0be6a 100644 --- a/docs/en-US/component/datetime-picker.md +++ b/docs/en-US/component/datetime-picker.md @@ -197,6 +197,10 @@ Set the `align-right` property to display the picker's value aligned to the righ Set the `before-confirm` function, which will be executed when the user clicks the 'confirm' button. It receives `value` (string for time type, timestamp for others, array when picker is in range selection mode), `resolve`, and `picker` parameters. You can validate the `value` and use the `resolve` function to tell the component whether to confirm. `resolve` accepts a boolean value, `resolve(true)` means the option is approved, `resolve(false)` means the option is not approved, and the picker popup won't close when not approved. You can directly set properties like `loading` through the `picker` parameter. +:::tip Note +Before calling `resolve`, ensure that the `picker` parameter's `loading` state is set to `false`, otherwise the component's `@confirm` event cannot be triggered correctly. +::: + ```html