From 6e6e35ae4a0848549a20168c779be175e36be1b2 Mon Sep 17 00:00:00 2001 From: invalid w Date: Tue, 13 Aug 2024 11:11:13 +0800 Subject: [PATCH 1/3] chore(@vben/playground): add a clipboard example (#4133) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(@vben/playground): 增加剪切板示例 * chore: rm unuse code --- playground/src/locales/langs/en-US.json | 3 ++- playground/src/locales/langs/zh-CN.json | 3 ++- playground/src/router/routes/modules/demos.ts | 9 ++++++++ .../views/demos/features/clipboard/index.vue | 23 +++++++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 playground/src/views/demos/features/clipboard/index.vue diff --git a/playground/src/locales/langs/en-US.json b/playground/src/locales/langs/en-US.json index 13179fd2..5b4b7cec 100644 --- a/playground/src/locales/langs/en-US.json +++ b/playground/src/locales/langs/en-US.json @@ -47,7 +47,8 @@ "icons": "Icons", "watermark": "Watermark", "tabs": "Tabs", - "tabDetail": "Tab Detail Page" + "tabDetail": "Tab Detail Page", + "clipboard": "Clipboard" }, "breadcrumb": { "navigation": "Breadcrumb Navigation", diff --git a/playground/src/locales/langs/zh-CN.json b/playground/src/locales/langs/zh-CN.json index 86fbcabc..dfab5e01 100644 --- a/playground/src/locales/langs/zh-CN.json +++ b/playground/src/locales/langs/zh-CN.json @@ -47,7 +47,8 @@ "icons": "图标", "watermark": "水印", "tabs": "标签页", - "tabDetail": "标签详情页" + "tabDetail": "标签详情页", + "clipboard": "剪贴板" }, "breadcrumb": { "navigation": "面包屑导航", diff --git a/playground/src/router/routes/modules/demos.ts b/playground/src/router/routes/modules/demos.ts index ad88a548..fd5df4b4 100644 --- a/playground/src/router/routes/modules/demos.ts +++ b/playground/src/router/routes/modules/demos.ts @@ -165,6 +165,15 @@ const routes: RouteRecordRaw[] = [ }, ], }, + { + name: 'ClipboardDemo', + path: '/demos/features/clipboard', + component: () => + import('#/views/demos/features/clipboard/index.vue'), + meta: { + title: $t('page.demos.features.clipboard'), + }, + }, ], }, // 面包屑导航 diff --git a/playground/src/views/demos/features/clipboard/index.vue b/playground/src/views/demos/features/clipboard/index.vue new file mode 100644 index 00000000..687cbbae --- /dev/null +++ b/playground/src/views/demos/features/clipboard/index.vue @@ -0,0 +1,23 @@ + + + From f20c5d9e2e636a9525e590371e92862a46802da8 Mon Sep 17 00:00:00 2001 From: invalid w Date: Tue, 13 Aug 2024 11:37:03 +0800 Subject: [PATCH 2/3] feat(@vben/playground): add full-screen examples (#4126) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(@vben/playground): add full-screen examples * chore: rm unuse class * chore: move fullScreen demo to features router * chore: responsive * chore: 调整路由路径 * chore: card增加间距 --------- Co-authored-by: Li Kui <90845831+likui628@users.noreply.github.com> --- playground/src/locales/langs/en-US.json | 3 ++ playground/src/locales/langs/zh-CN.json | 3 ++ playground/src/router/routes/modules/demos.ts | 9 ++++ .../src/router/routes/modules/examples.ts | 2 +- .../demos/features/full-screen/index.vue | 47 +++++++++++++++++++ 5 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 playground/src/views/demos/features/full-screen/index.vue diff --git a/playground/src/locales/langs/en-US.json b/playground/src/locales/langs/en-US.json index 5b4b7cec..ee931056 100644 --- a/playground/src/locales/langs/en-US.json +++ b/playground/src/locales/langs/en-US.json @@ -48,6 +48,9 @@ "watermark": "Watermark", "tabs": "Tabs", "tabDetail": "Tab Detail Page", + "fullScreen": { + "title": "FullScreen" + }, "clipboard": "Clipboard" }, "breadcrumb": { diff --git a/playground/src/locales/langs/zh-CN.json b/playground/src/locales/langs/zh-CN.json index dfab5e01..5b5a65e5 100644 --- a/playground/src/locales/langs/zh-CN.json +++ b/playground/src/locales/langs/zh-CN.json @@ -48,6 +48,9 @@ "watermark": "水印", "tabs": "标签页", "tabDetail": "标签详情页", + "fullScreen": { + "title": "全屏" + }, "clipboard": "剪贴板" }, "breadcrumb": { diff --git a/playground/src/router/routes/modules/demos.ts b/playground/src/router/routes/modules/demos.ts index fd5df4b4..08a19d63 100644 --- a/playground/src/router/routes/modules/demos.ts +++ b/playground/src/router/routes/modules/demos.ts @@ -165,6 +165,15 @@ const routes: RouteRecordRaw[] = [ }, ], }, + { + name: 'FullScreenDemo', + path: '/demos/features/full-screen', + component: () => + import('#/views/demos/features/full-screen/index.vue'), + meta: { + title: $t('page.demos.features.fullScreen.title'), + }, + }, { name: 'ClipboardDemo', path: '/demos/features/clipboard', diff --git a/playground/src/router/routes/modules/examples.ts b/playground/src/router/routes/modules/examples.ts index bd1ec467..fd3fd237 100644 --- a/playground/src/router/routes/modules/examples.ts +++ b/playground/src/router/routes/modules/examples.ts @@ -17,7 +17,7 @@ const routes: RouteRecordRaw[] = [ children: [ { name: 'EllipsisDemo', - path: '/examples/ellipsis', + path: 'ellipsis', component: () => import('#/views/examples/ellipsis/index.vue'), meta: { title: $t('page.examples.ellipsis.title'), diff --git a/playground/src/views/demos/features/full-screen/index.vue b/playground/src/views/demos/features/full-screen/index.vue new file mode 100644 index 00000000..b5f7502d --- /dev/null +++ b/playground/src/views/demos/features/full-screen/index.vue @@ -0,0 +1,47 @@ + + + From 843ec1e7491b2969ab8a7bcd2966c831d2ad304a Mon Sep 17 00:00:00 2001 From: Netfan Date: Tue, 13 Aug 2024 11:49:02 +0800 Subject: [PATCH 3/3] fix: tab close by key, fixed: #4132 (#4136) --- packages/stores/src/modules/tabbar.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/stores/src/modules/tabbar.ts b/packages/stores/src/modules/tabbar.ts index c385ae97..a3738103 100644 --- a/packages/stores/src/modules/tabbar.ts +++ b/packages/stores/src/modules/tabbar.ts @@ -77,6 +77,7 @@ export const useTabbarStore = defineStore('core-tabbar', { /** * @zh_CN 跳转到标签页 * @param tab + * @param router */ async _goToTab(tab: TabDefinition, router: Router) { const { params, path, query } = tab; @@ -243,9 +244,13 @@ export const useTabbarStore = defineStore('core-tabbar', { /** * @zh_CN 通过key关闭标签页 * @param key + * @param router */ async closeTabByKey(key: string, router: Router) { - const index = this.tabs.findIndex((item) => getTabPath(item) === key); + const originKey = decodeURIComponent(key); + const index = this.tabs.findIndex( + (item) => getTabPath(item) === originKey, + ); if (index === -1) { return; }