Update navigation routing and add Element Plus plugin

This commit is contained in:
wangqiao
2025-08-23 21:35:25 +08:00
parent 38f6d8c062
commit ee8ce32af6
2 changed files with 11 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="w-[100%] border-b-[1px] border-b-[#eee] border-b-solid"> <div class="w-[100%] border-b-[1px] border-b-[#eee] border-b-solid">
<div class="relative ma-auto flex items-center py-[20px] w-[1500px]!"> <div class="relative ma-auto flex items-center py-[20px] w-[1500px]!">
<img src="~/assets/images/logo5.png" alt="图夕夕" srcset="" class="h-[51px] w-[182px] cursor-pointer" @click="router.push('/index')" /> <img src="~/assets/images/logo5.png" alt="图夕夕" srcset="" class="h-[51px] w-[182px] cursor-pointer" @click="navigateTo('/')" />
<div class="ml-[60px] flex items-center"> <div class="ml-[60px] flex items-center">
<span v-for="item in navList" :key="item" class="nav" :class="props.active === item ? 'active' : ''" @click="handleClick(item)">{{ item }}</span> <span v-for="item in navList" :key="item" class="nav" :class="props.active === item ? 'active' : ''" @click="handleClick(item)">{{ item }}</span>
</div> </div>
@ -146,7 +146,7 @@
const handleClick = (item: string) => { const handleClick = (item: string) => {
switch (item) { switch (item) {
case '首页': case '首页':
navigateTo('/') // 修改为在新窗口打开 navigateTo({ path: '/'}) // 修改为在新窗口打开
break break
case '图纸': case '图纸':
navigateTo('/drawe') // 修改为在新窗口打开 navigateTo('/drawe') // 修改为在新窗口打开

9
plugins/element.ts Normal file
View File

@ -0,0 +1,9 @@
import { defineNuxtPlugin } from '#app'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
export default defineNuxtPlugin(nuxtApp => {
nuxtApp.vueApp.use(ElementPlus, {
locale: zhCn
})
})