路由配置优化及页面元信息添加
This commit is contained in:
@ -13,6 +13,11 @@ import { routes } from 'vue-router/auto-routes';
|
||||
// const Login = () => import("@/views/Login.vue");
|
||||
// const NotFound = () => import("@/views/NotFound.vue");
|
||||
|
||||
routes.unshift({
|
||||
path: "/",
|
||||
redirect: "/home",
|
||||
});
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes:routes as any
|
||||
|
||||
@ -6,6 +6,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
definePage({
|
||||
name:'appshare',
|
||||
meta: {
|
||||
title: '软件分享',
|
||||
}
|
||||
})
|
||||
// 软件分享页逻辑
|
||||
</script>
|
||||
|
||||
|
||||
@ -6,6 +6,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
definePage({
|
||||
name:'article',
|
||||
meta: {
|
||||
title: '文章',
|
||||
}
|
||||
})
|
||||
// 文章页逻辑
|
||||
</script>
|
||||
|
||||
|
||||
@ -111,6 +111,15 @@ import tao from "@/assets/images/树枝桃.png";
|
||||
import denglong from "@/assets/images/灯笼.png";
|
||||
import { throttle } from 'es-toolkit';
|
||||
import { nextTick, onMounted, onUnmounted, ref } from 'vue';
|
||||
|
||||
definePage({
|
||||
name:'gallery',
|
||||
meta: {
|
||||
title: '画廊',
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 画廊页逻辑
|
||||
const tid = ref('share');
|
||||
const fileList = ref<any[]>([]);
|
||||
@ -195,12 +204,12 @@ function getImageSizeByCheck(url: string): any {
|
||||
image.src = url;
|
||||
let height = 0
|
||||
let width = 0
|
||||
let timer = setInterval(() => {
|
||||
let timer = setTimeout(() => {
|
||||
if (image.width > 0 && image.height > 0) {
|
||||
height = image.height
|
||||
width = image.width
|
||||
resolve({ height, width })
|
||||
clearInterval(timer)
|
||||
clearTimeout(timer)
|
||||
}
|
||||
}, 40)
|
||||
});
|
||||
|
||||
@ -81,7 +81,10 @@
|
||||
import { getDictValue } from '@/util/index.ts'
|
||||
|
||||
definePage({
|
||||
name:'home'
|
||||
name:'home',
|
||||
meta: {
|
||||
title: '首页',
|
||||
}
|
||||
})
|
||||
|
||||
// 新增导航弹窗
|
||||
|
||||
@ -37,6 +37,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
definePage({
|
||||
name:'login',
|
||||
meta: {
|
||||
title: '登录',
|
||||
}
|
||||
})
|
||||
|
||||
const router = useRouter()
|
||||
// 登录注册逻辑
|
||||
|
||||
@ -5,6 +5,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
definePage({
|
||||
name:'404',
|
||||
meta: {
|
||||
title: '错误',
|
||||
}
|
||||
})
|
||||
// 404页面
|
||||
</script>
|
||||
|
||||
|
||||
@ -6,6 +6,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
definePage({
|
||||
name:'plink',
|
||||
meta: {
|
||||
title: '友链',
|
||||
}
|
||||
})
|
||||
// 友链页逻辑
|
||||
</script>
|
||||
|
||||
|
||||
@ -6,6 +6,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
definePage({
|
||||
name:'widget',
|
||||
meta: {
|
||||
title: '工具',
|
||||
}
|
||||
})
|
||||
// 工具页逻辑
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user