From 8cc73cf59cfe0d5d002f98fecffc60f00bb05a9a Mon Sep 17 00:00:00 2001 From: Arthur Darkstone Date: Wed, 13 Nov 2024 15:43:17 +0800 Subject: [PATCH] feat: add reize components & demo (#4862) * feat: resize component * chore: change positon of resize components * feat: add resize demo * chore: resize demo completed * chore: fix display number * chore: add infer comment * fix: move reszie demo to examples * fix: fix icon & removed scss --- .vscode/settings.json | 3 +- cspell.json | 54 +- .../effects/common-ui/src/components/index.ts | 1 + .../common-ui/src/components/resize/index.ts | 1 + .../src/components/resize/resize.vue | 1122 +++++++++++++++++ .../src/locales/langs/zh-CN/examples.json | 3 + .../src/router/routes/modules/examples.ts | 9 + .../src/views/examples/resize/basic.vue | 44 + 8 files changed, 1210 insertions(+), 27 deletions(-) create mode 100644 packages/effects/common-ui/src/components/resize/index.ts create mode 100644 packages/effects/common-ui/src/components/resize/resize.vue create mode 100644 playground/src/views/examples/resize/basic.vue diff --git a/.vscode/settings.json b/.vscode/settings.json index 29deba76ace..8b76b276243 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -222,5 +222,6 @@ "commentTranslate.hover.enabled": false, "commentTranslate.multiLineMerge": true, "vue.server.hybridMode": true, - "typescript.tsdk": "node_modules/typescript/lib" + "typescript.tsdk": "node_modules/typescript/lib", + "oxc.enable": false } diff --git a/cspell.json b/cspell.json index b4cbb962243..89545b43216 100644 --- a/cspell.json +++ b/cspell.json @@ -4,53 +4,55 @@ "language": "en,en-US", "allowCompoundWords": true, "words": [ - "clsx", - "esno", - "demi", - "unref", - "taze", "acmr", "antd", - "lucide", + "antdv", + "astro", "brotli", + "clsx", "defu", + "demi", + "echarts", + "ependencies", + "esno", + "etag", "execa", "iconify", + "iconoir", "intlify", + "lockb", + "lucide", + "minh", + "minw", "mkdist", "mockjs", - "vitejs", + "naiveui", + "nocheck", "noopener", "noreferrer", "nprogress", + "nuxt", "pinia", + "prefixs", "publint", "qrcode", "shadcn", "sonner", + "sortablejs", + "styl", + "taze", + "ui-kit", + "uicons", "unplugin", + "unref", "vben", "vbenjs", - "vueuse", - "yxxx", - "nuxt", - "lockb", - "astro", - "ui-kit", - "styl", - "vnode", - "nocheck", - "prefixs", - "vitepress", - "antdv", - "ependencies", "vite", - "echarts", - "sortablejs", - "etag", - "naiveui", - "uicons", - "iconoir" + "vitejs", + "vitepress", + "vnode", + "vueuse", + "yxxx" ], "ignorePaths": [ "**/node_modules/**", diff --git a/packages/effects/common-ui/src/components/index.ts b/packages/effects/common-ui/src/components/index.ts index f5e3c7a9b49..b7ae8548bf1 100644 --- a/packages/effects/common-ui/src/components/index.ts +++ b/packages/effects/common-ui/src/components/index.ts @@ -2,6 +2,7 @@ export * from './captcha'; export * from './ellipsis-text'; export * from './icon-picker'; export * from './page'; +export * from './resize'; export * from '@vben-core/form-ui'; export * from '@vben-core/popup-ui'; diff --git a/packages/effects/common-ui/src/components/resize/index.ts b/packages/effects/common-ui/src/components/resize/index.ts new file mode 100644 index 00000000000..f9375221d4c --- /dev/null +++ b/packages/effects/common-ui/src/components/resize/index.ts @@ -0,0 +1 @@ +export { default as VResize } from './resize.vue'; diff --git a/packages/effects/common-ui/src/components/resize/resize.vue b/packages/effects/common-ui/src/components/resize/resize.vue new file mode 100644 index 00000000000..aaf89eaf2b2 --- /dev/null +++ b/packages/effects/common-ui/src/components/resize/resize.vue @@ -0,0 +1,1122 @@ + + + + + diff --git a/playground/src/locales/langs/zh-CN/examples.json b/playground/src/locales/langs/zh-CN/examples.json index 5a6c1a27e8d..227ec49433e 100644 --- a/playground/src/locales/langs/zh-CN/examples.json +++ b/playground/src/locales/langs/zh-CN/examples.json @@ -9,6 +9,9 @@ "ellipsis": { "title": "文本省略" }, + "resize": { + "title": "拖动调整" + }, "form": { "title": "表单", "basic": "基础表单", diff --git a/playground/src/router/routes/modules/examples.ts b/playground/src/router/routes/modules/examples.ts index 4adee5e5ad7..82202b381e6 100644 --- a/playground/src/router/routes/modules/examples.ts +++ b/playground/src/router/routes/modules/examples.ts @@ -228,6 +228,15 @@ const routes: RouteRecordRaw[] = [ title: $t('examples.ellipsis.title'), }, }, + { + name: 'VueResizeDemo', + path: '/demos/resize/basic', + component: () => import('#/views/examples/resize/basic.vue'), + meta: { + icon: 'material-symbols:resize', + title: $t('examples.resize.title'), + }, + }, ], }, ]; diff --git a/playground/src/views/examples/resize/basic.vue b/playground/src/views/examples/resize/basic.vue new file mode 100644 index 00000000000..a8fcd0dc0a2 --- /dev/null +++ b/playground/src/views/examples/resize/basic.vue @@ -0,0 +1,44 @@ + + +