Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin
This commit is contained in:
commit
895b5bc8d0
@ -77,6 +77,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
|
|||||||
/**
|
/**
|
||||||
* @zh_CN 跳转到标签页
|
* @zh_CN 跳转到标签页
|
||||||
* @param tab
|
* @param tab
|
||||||
|
* @param router
|
||||||
*/
|
*/
|
||||||
async _goToTab(tab: TabDefinition, router: Router) {
|
async _goToTab(tab: TabDefinition, router: Router) {
|
||||||
const { params, path, query } = tab;
|
const { params, path, query } = tab;
|
||||||
@ -243,9 +244,13 @@ export const useTabbarStore = defineStore('core-tabbar', {
|
|||||||
/**
|
/**
|
||||||
* @zh_CN 通过key关闭标签页
|
* @zh_CN 通过key关闭标签页
|
||||||
* @param key
|
* @param key
|
||||||
|
* @param router
|
||||||
*/
|
*/
|
||||||
async closeTabByKey(key: string, router: 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) {
|
if (index === -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,11 @@
|
|||||||
"icons": "Icons",
|
"icons": "Icons",
|
||||||
"watermark": "Watermark",
|
"watermark": "Watermark",
|
||||||
"tabs": "Tabs",
|
"tabs": "Tabs",
|
||||||
"tabDetail": "Tab Detail Page"
|
"tabDetail": "Tab Detail Page",
|
||||||
|
"fullScreen": {
|
||||||
|
"title": "FullScreen"
|
||||||
|
},
|
||||||
|
"clipboard": "Clipboard"
|
||||||
},
|
},
|
||||||
"breadcrumb": {
|
"breadcrumb": {
|
||||||
"navigation": "Breadcrumb Navigation",
|
"navigation": "Breadcrumb Navigation",
|
||||||
|
@ -47,7 +47,11 @@
|
|||||||
"icons": "图标",
|
"icons": "图标",
|
||||||
"watermark": "水印",
|
"watermark": "水印",
|
||||||
"tabs": "标签页",
|
"tabs": "标签页",
|
||||||
"tabDetail": "标签详情页"
|
"tabDetail": "标签详情页",
|
||||||
|
"fullScreen": {
|
||||||
|
"title": "全屏"
|
||||||
|
},
|
||||||
|
"clipboard": "剪贴板"
|
||||||
},
|
},
|
||||||
"breadcrumb": {
|
"breadcrumb": {
|
||||||
"navigation": "面包屑导航",
|
"navigation": "面包屑导航",
|
||||||
|
@ -165,6 +165,24 @@ 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',
|
||||||
|
component: () =>
|
||||||
|
import('#/views/demos/features/clipboard/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: $t('page.demos.features.clipboard'),
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// 面包屑导航
|
// 面包屑导航
|
||||||
|
@ -17,7 +17,7 @@ const routes: RouteRecordRaw[] = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: 'EllipsisDemo',
|
name: 'EllipsisDemo',
|
||||||
path: '/examples/ellipsis',
|
path: 'ellipsis',
|
||||||
component: () => import('#/views/examples/ellipsis/index.vue'),
|
component: () => import('#/views/examples/ellipsis/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: $t('page.examples.ellipsis.title'),
|
title: $t('page.examples.ellipsis.title'),
|
||||||
|
23
playground/src/views/demos/features/clipboard/index.vue
Normal file
23
playground/src/views/demos/features/clipboard/index.vue
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
import { Page } from '@vben/common-ui';
|
||||||
|
|
||||||
|
import { useClipboard } from '@vueuse/core';
|
||||||
|
import { Button, Input } from 'ant-design-vue';
|
||||||
|
|
||||||
|
const source = ref('Hello');
|
||||||
|
const { copy, text } = useClipboard({ source });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Page title="剪切板示例">
|
||||||
|
<p class="mb-3">
|
||||||
|
Current copied: <code>{{ text || 'none' }}</code>
|
||||||
|
</p>
|
||||||
|
<Input.Group class="flex">
|
||||||
|
<Input v-model:value="source" placeholder="请输入" />
|
||||||
|
<Button type="primary" @click="copy(source)"> Copy </Button>
|
||||||
|
</Input.Group>
|
||||||
|
</Page>
|
||||||
|
</template>
|
47
playground/src/views/demos/features/full-screen/index.vue
Normal file
47
playground/src/views/demos/features/full-screen/index.vue
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
import { Page } from '@vben/common-ui';
|
||||||
|
|
||||||
|
import { useFullscreen } from '@vueuse/core';
|
||||||
|
import { Button, Card } from 'ant-design-vue';
|
||||||
|
|
||||||
|
const domRef = ref<HTMLElement>();
|
||||||
|
|
||||||
|
const { enter, exit, isFullscreen, toggle } = useFullscreen();
|
||||||
|
|
||||||
|
const { isFullscreen: isDomFullscreen, toggle: toggleDom } =
|
||||||
|
useFullscreen(domRef);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Page title="全屏示例">
|
||||||
|
<Card title="Window Full Screen">
|
||||||
|
<div class="flex flex-wrap items-center gap-4">
|
||||||
|
<Button :disabled="isFullscreen" type="primary" @click="enter">
|
||||||
|
Enter Window Full Screen
|
||||||
|
</Button>
|
||||||
|
<Button @click="toggle"> Toggle Window Full Screen </Button>
|
||||||
|
|
||||||
|
<Button :disabled="!isFullscreen" danger @click="exit">
|
||||||
|
Exit Window Full Screen
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<span class="text-nowrap"> Current State: {{ isFullscreen }} </span>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Card class="mt-3" title="Dom Full Screen">
|
||||||
|
<Button type="primary" @click="toggleDom"> Enter Dom Full Screen </Button>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<div
|
||||||
|
ref="domRef"
|
||||||
|
class="mx-auto mt-10 flex h-64 w-1/2 items-center justify-center rounded-md bg-yellow-400"
|
||||||
|
>
|
||||||
|
<Button class="mr-2" type="primary" @click="toggleDom">
|
||||||
|
{{ isDomFullscreen ? 'Exit Dom Full Screen' : 'Enter Dom Full Screen' }}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</Page>
|
||||||
|
</template>
|
Loading…
Reference in New Issue
Block a user