feat(menu): 为页面添加标题和布局配置支持
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
definePage({
|
||||
meta: {
|
||||
title: 'API 调用示例',
|
||||
},
|
||||
});
|
||||
|
||||
// ========== API 模块 ==========
|
||||
const apiResult = ref<string>('');
|
||||
const loading = ref(false);
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
import { ref } from 'vue';
|
||||
import { NButton } from 'naive-ui';
|
||||
|
||||
definePage({
|
||||
meta: {
|
||||
title: '点击计数器',
|
||||
},
|
||||
});
|
||||
|
||||
// ========== 计数器模块 ==========
|
||||
const clickCount = ref(0);
|
||||
|
||||
|
||||
4
src/pages/demos/index.page.vue
Normal file
4
src/pages/demos/index.page.vue
Normal file
@@ -0,0 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
definePage({ meta: { title: '示例演示' } });
|
||||
</script>
|
||||
<template>这个文件只是为了给菜单渲染标题</template>
|
||||
@@ -1,6 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onUnmounted, computed, nextTick } from 'vue';
|
||||
|
||||
definePage({
|
||||
meta: {
|
||||
title: 'WebSocket 示例',
|
||||
},
|
||||
});
|
||||
|
||||
// ========== WebSocket 模块 ==========
|
||||
const ws = ref<WebSocket | null>(null);
|
||||
const wsConnected = ref(false);
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<template>
|
||||
<div>deep</div>
|
||||
</template>
|
||||
@@ -1,5 +0,0 @@
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<template>
|
||||
<div>deep2</div>
|
||||
</template>
|
||||
@@ -1,5 +0,0 @@
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<template>
|
||||
<div>Demo-API-Page</div>
|
||||
</template>
|
||||
@@ -1,5 +0,0 @@
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<template>
|
||||
<div>Demo-Icons-Page</div>
|
||||
</template>
|
||||
@@ -52,6 +52,11 @@ declare module 'vue-router' {
|
||||
* @description 菜单标题
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* @description 使用的布局,设置为 false 则表示不使用布局
|
||||
*/
|
||||
layout?: string | false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user