chore: update demo

pull/48/MERGE
vben 2024-06-16 23:25:28 +08:00
parent 0023964eb7
commit 6c092e284c
9 changed files with 35 additions and 47 deletions

View File

@ -29,12 +29,24 @@ const routes: RouteRecordRaw[] = [
{ {
name: 'Menu2', name: 'Menu2',
path: 'menu2', path: 'menu2',
component: () => import('@/views/nested/menu-2.vue'),
meta: { meta: {
icon: 'ic:round-menu', icon: 'ic:round-menu',
keepAlive: true, keepAlive: true,
title: $t('page.nested.menu2'), title: $t('page.nested.menu2'),
}, },
redirect: '/nested/menu2/menu2-1',
children: [
{
name: 'Menu21',
path: 'menu2-1',
component: () => import('@/views/nested/menu-2-1.vue'),
meta: {
icon: 'ic:round-menu',
keepAlive: true,
title: $t('page.nested.menu21'),
},
},
],
}, },
{ {
name: 'Menu3', name: 'Menu3',

View File

@ -1,16 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from 'vue'; import { Fallback } from '@vben/universal-ui';
defineOptions({ name: 'Menu1' }); defineOptions({ name: 'Menu1' });
onMounted(() => {
// eslint-disable-next-line no-console
console.log('Menu1');
});
</script> </script>
<template> <template>
<div class="p-5"> <Fallback status="hello" />
menu1
<input class="bg-background border-border" />
</div>
</template> </template>

View File

@ -0,0 +1,9 @@
<script lang="ts" setup>
import { Fallback } from '@vben/universal-ui';
defineOptions({ name: 'Menu21' });
</script>
<template>
<Fallback status="hello" />
</template>

View File

@ -1,16 +0,0 @@
<script lang="ts" setup>
import { onMounted } from 'vue';
defineOptions({ name: 'Menu2' });
onMounted(() => {
// eslint-disable-next-line no-console
console.log('Menu2');
});
</script>
<template>
<div class="p-5">
menu2
<input class="bg-background border-border" />
</div>
</template>

View File

@ -1,15 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from 'vue'; import { Fallback } from '@vben/universal-ui';
defineOptions({ name: 'Menu31' }); defineOptions({ name: 'Menu31' });
onMounted(() => {
// eslint-disable-next-line no-console
console.log('Menu3-1');
});
</script> </script>
<template> <template>
<div class="p-5"> <Fallback status="hello" />
Menu3-1
<input class="bg-background border-border" />
</div>
</template> </template>

View File

@ -1,15 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from 'vue'; import { Fallback } from '@vben/universal-ui';
defineOptions({ name: 'Menu321' }); defineOptions({ name: 'Menu321' });
onMounted(() => {
// eslint-disable-next-line no-console
console.log('Menu3-2-1');
});
</script> </script>
<template> <template>
<div class="p-5"> <Fallback status="hello" />
menu-3-2-1
<input class="bg-background border-border" />
</div>
</template> </template>

View File

@ -136,14 +136,14 @@ function refresh() {
<slot v-if="$slots.title" name="title"></slot> <slot v-if="$slots.title" name="title"></slot>
<p <p
v-else-if="titleText" v-else-if="titleText"
class="text-foreground mt-12 text-3xl md:text-4xl lg:text-5xl" class="text-foreground mt-8 text-2xl md:text-3xl lg:text-4xl"
> >
{{ titleText }} {{ titleText }}
</p> </p>
<slot v-if="$slots.describe" name="describe"></slot> <slot v-if="$slots.describe" name="describe"></slot>
<p <p
v-else-if="descText" v-else-if="descText"
class="text-muted-foreground md:text-md my-6 lg:text-lg" class="text-muted-foreground md:text-md my-4 lg:text-lg"
> >
{{ descText }} {{ descText }}
</p> </p>

View File

@ -109,6 +109,7 @@ page:
page: Nested Menu page: Nested Menu
menu1: Menu 1 menu1: Menu 1
menu2: Menu 2 menu2: Menu 2
menu21: Menu 2-1
menu3: Menu 3 menu3: Menu 3
menu31: Menu 3-1 menu31: Menu 3-1
menu32: Menu 3-2 menu32: Menu 3-2

View File

@ -108,6 +108,7 @@ page:
page: 嵌套菜单 page: 嵌套菜单
menu1: 菜单 1 menu1: 菜单 1
menu2: 菜单 2 menu2: 菜单 2
menu21: 菜单 2-1
menu3: 菜单 3 menu3: 菜单 3
menu31: 菜单 3-1 menu31: 菜单 3-1
menu32: 菜单 3-2 menu32: 菜单 3-2