From aec2a3542415b37e5d149ea8f6bdc95374c76756 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Mon, 12 Jun 2023 21:11:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=98=B2=E6=8A=96?= =?UTF-8?q?=E3=80=81=E6=88=AA=E6=B5=81=E3=80=81=E5=A4=8D=E5=88=B6=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=8C=87=E4=BB=A4=E4=BD=BF=E7=94=A8=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en.yaml | 1 + locales/zh-CN.yaml | 1 + src/directives/optimize/index.ts | 2 +- src/router/modules/able.ts | 9 +++ src/views/able/directives.vue | 117 +++++++++++++++++++++++++++++++ 5 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 src/views/able/directives.vue diff --git a/locales/en.yaml b/locales/en.yaml index 96a4ccbea..9eed96fcc 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -68,6 +68,7 @@ menus: hsguide: Guide hsAble: Able hsMenuTree: Menu Tree + hsOptimize: Debounce、Throttle、Copy Directives hsWatermark: Water Mark hsPrint: Print hsDownload: Download diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index 8cb2f1584..eb34b895e 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -68,6 +68,7 @@ menus: hsguide: 引导页 hsAble: 功能 hsMenuTree: 菜单树结构 + hsOptimize: 防抖、截流、复制指令 hsWatermark: 水印 hsPrint: 打印 hsDownload: 下载 diff --git a/src/directives/optimize/index.ts b/src/directives/optimize/index.ts index d56f23b7c..43ac38ac8 100644 --- a/src/directives/optimize/index.ts +++ b/src/directives/optimize/index.ts @@ -38,7 +38,7 @@ export const optimize: Directive = { ) : throttle( params ? () => value.fn(...params) : value.fn, - value?.timeout ?? 200 + value?.timeout ?? 1000 ) ); } else { diff --git a/src/router/modules/able.ts b/src/router/modules/able.ts index aaca0bdf5..35e5bef0f 100644 --- a/src/router/modules/able.ts +++ b/src/router/modules/able.ts @@ -10,6 +10,15 @@ export default { rank: able }, children: [ + { + path: "/able/directives", + name: "Directives", + component: () => import("@/views/able/directives.vue"), + meta: { + title: $t("menus.hsOptimize"), + extraIcon: "IF-pure-iconfont-new svg" + } + }, { path: "/able/watermark", name: "WaterMark", diff --git a/src/views/able/directives.vue b/src/views/able/directives.vue new file mode 100644 index 000000000..f3e566536 --- /dev/null +++ b/src/views/able/directives.vue @@ -0,0 +1,117 @@ + + +