diff --git a/packages/vant/src/signature/README.md b/packages/vant/src/signature/README.md index 494fa9a8e..08b4ef898 100644 --- a/packages/vant/src/signature/README.md +++ b/packages/vant/src/signature/README.md @@ -106,6 +106,8 @@ Use [ref](https://vuejs.org/guide/essentials/template-refs.html) to get Signatur | Name | Description | Attribute | Return value | | --- | --- | --- | --- | | resize `v4.7.3` | Resize Signature when container element resized or visibility changed | - | - | +| clear `v4.8.6` | Can be called to clear the signature | - | - | +| submit `v4.8.6` | Trigger the `submit` event, which is equivalent to clicking the confirm button. | - | - | ### Types diff --git a/packages/vant/src/signature/README.zh-CN.md b/packages/vant/src/signature/README.zh-CN.md index dccf64ca3..3ab70b9b4 100644 --- a/packages/vant/src/signature/README.zh-CN.md +++ b/packages/vant/src/signature/README.zh-CN.md @@ -106,6 +106,8 @@ export default { | 方法名 | 说明 | 参数 | 返回值 | | --- | --- | --- | --- | | resize `v4.7.3` | 外层元素大小或组件显示状态变化时,可以调用此方法来触发重绘 | - | - | +| clear `v4.8.6` | 可调用此方法来清除签名 | - | - | +| submit `v4.8.6` | 触发 `submit` 事件,与点击确认按钮的效果等价 | - | - | ### 类型定义 diff --git a/packages/vant/src/signature/Signature.tsx b/packages/vant/src/signature/Signature.tsx index adbe22a70..2a52ba95b 100644 --- a/packages/vant/src/signature/Signature.tsx +++ b/packages/vant/src/signature/Signature.tsx @@ -181,6 +181,8 @@ export default defineComponent({ useExpose({ resize, + clear, + submit, }); return () => ( diff --git a/packages/vant/src/signature/types.ts b/packages/vant/src/signature/types.ts index d69469cb1..352c6d305 100644 --- a/packages/vant/src/signature/types.ts +++ b/packages/vant/src/signature/types.ts @@ -3,6 +3,8 @@ import type { SignatureProps } from './Signature'; export type SignatureExpose = { resize: () => void; + clear: () => void; + submit: () => void; }; export type SignatureInstance = ComponentPublicInstance<