From cad5b2b9c42abe47d54a856cc284adf7a6de1f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=A6=82=E6=91=B8=E9=B1=BC=E5=8E=BB?= <1780903673@qq.com> Date: Sun, 16 Feb 2025 15:58:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20Toast=20=E9=83=A8=E5=88=86=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E7=9A=84=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/component/toast.md | 1 - .../wot-design-uni/components/wd-toast/index.ts | 3 ++- .../wot-design-uni/components/wd-toast/types.ts | 11 +---------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/docs/component/toast.md b/docs/component/toast.md index eb0b0394..c9d26eea 100644 --- a/docs/component/toast.md +++ b/docs/component/toast.md @@ -125,7 +125,6 @@ toast.close() |--------------|------------------------------------------|----------|--------------------------------------------|------------|------------------| | selector | 选择器 | string | - | '' | - | | msg | 提示信息 | string | - | '' | $LOWEST_VERSION$ | -| duration | 持续时间,单位 ms,为 0 时表示不自动关闭 | number | - | 2000 | $LOWEST_VERSION$ | | direction | 排列方向 | string | vertical / horizontal | horizontal | $LOWEST_VERSION$ | | iconName | 图标类型 | string | success / error / warning / loading / info | '' | $LOWEST_VERSION$ | | iconSize | 图标大小 | number | - | - | $LOWEST_VERSION$ | diff --git a/src/uni_modules/wot-design-uni/components/wd-toast/index.ts b/src/uni_modules/wot-design-uni/components/wd-toast/index.ts index 7403cd50..0264e62d 100644 --- a/src/uni_modules/wot-design-uni/components/wd-toast/index.ts +++ b/src/uni_modules/wot-design-uni/components/wd-toast/index.ts @@ -9,6 +9,7 @@ const toastDefaultOptionKey = '__TOAST_OPTION__' // 默认模板 export const defaultOptions: ToastOptions = { + duration: 2000, show: false } @@ -83,7 +84,7 @@ export const toastIcon = { return '警告Created with Sketch. ' }, info() { - return '常规Created with Sketch.' + return '常规Created with Sketch.' }, error() { return 'toastCreated with Sketch. ' diff --git a/src/uni_modules/wot-design-uni/components/wd-toast/types.ts b/src/uni_modules/wot-design-uni/components/wd-toast/types.ts index 6cfb4475..7209aed1 100644 --- a/src/uni_modules/wot-design-uni/components/wd-toast/types.ts +++ b/src/uni_modules/wot-design-uni/components/wd-toast/types.ts @@ -1,7 +1,7 @@ /* * @Author: weisheng * @Date: 2023-06-19 12:47:57 - * @LastEditTime: 2025-02-11 21:34:01 + * @LastEditTime: 2025-02-16 15:52:17 * @LastEditors: weisheng * @Description: * @FilePath: /wot-design-uni/src/uni_modules/wot-design-uni/components/wd-toast/types.ts @@ -88,15 +88,6 @@ export const toastProps = { type: String, default: '' }, - /** - * 持续时间 - * @type {number} - * @default 2000 - */ - duration: { - type: Number, - default: 2000 - }, /** * 排列方向 * @type {'vertical' | 'horizontal'}