修改标题logo 修复侧边栏收缩闪烁

master
Your Name 7 months ago
parent 2557174431
commit be31783972
  1. 1
      .eslintcache
  2. 2
      index.html
  3. 1
      package.json
  4. 1
      src/assets/icons/count.svg
  5. 2
      src/layout/index.vue
  6. 4
      src/layout/main/index.vue
  7. 19
      src/layout/menu/index.vue
  8. 4
      src/main.ts
  9. 3
      src/permission.ts
  10. 4
      src/setting.ts
  11. 2
      src/styles/variable.scss
  12. 2
      src/views/home/index.vue

File diff suppressed because one or more lines are too long

@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>无糖运营平</title> <title>教学一体化后师生后</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

@ -14,7 +14,6 @@
"format": "prettier --write \"./**/*.{html,vue,ts,js,json,md}\"", "format": "prettier --write \"./**/*.{html,vue,ts,js,json,md}\"",
"lint:eslint": "eslint src/**/*.{ts,vue} --cache --fix", "lint:eslint": "eslint src/**/*.{ts,vue} --cache --fix",
"lint:style": "stylelint src/**/*.{css,scss,vue} --cache --fix", "lint:style": "stylelint src/**/*.{css,scss,vue} --cache --fix",
"prepare": "husky install",
"preinstall": "node ./scripts/preinstall.js" "preinstall": "node ./scripts/preinstall.js"
}, },
"dependencies": { "dependencies": {

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1712994089691" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1023" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M964 904H120V60A60 60 0 0 0 0 60v844a120.13 120.13 0 0 0 120 120h844a60 60 0 0 0 0-120z" fill="#1296db" p-id="1024"></path><path d="M186.2 844.17a60 60 0 0 0 80.11-28.67l99.1-211.12A60 60 0 0 1 438 572.72l149.61 47.78c50.79 16.21 104.44-11.41 125.75-64.35l129.13-280a60 60 0 0 0-109-50.24L629 452.49a60 60 0 0 1-72.73 32l-149.07-47.6a96.75 96.75 0 0 0-74.76 6.61c-20.9 10.92-37.58 28.7-48.24 51.42l-126.1 268.7c-14.1 30.02-1.85 66.29 28.1 80.55z" fill="#1296db" p-id="1025"></path></svg>

After

Width:  |  Height:  |  Size: 820 B

@ -15,7 +15,7 @@
:default-active="$route.path" :default-active="$route.path"
background-color="#001529" background-color="#001529"
text-color="#fff" text-color="#fff"
:collapse="LayoutSettingStoe.fold"
> >
<Menu :menuList="usePermissionStore.asyncRouter" /> <Menu :menuList="usePermissionStore.asyncRouter" />
</el-menu> </el-menu>

@ -3,7 +3,9 @@
<!-- 过度动画 --> <!-- 过度动画 -->
<transition name="fade"> <transition name="fade">
<!-- 要渲染的组件 --> <!-- 要渲染的组件 -->
<component :is="Component" v-if="refresh" /> <div v-if="refresh" >
<component :is="Component"/>
</div>
</transition> </transition>
</router-view> </router-view>
</template> </template>

@ -16,7 +16,7 @@
<component :is="item.meta.icon"></component> <component :is="item.meta.icon"></component>
</el-icon> --> </el-icon> -->
<span>{{ item.meta.title }}</span> <span v-show="!fold">{{ item.meta.title }}</span>
</template> </template>
</el-menu-item> </el-menu-item>
</template> </template>
@ -32,7 +32,7 @@
<component :is="item.children[0].meta.icon"></component> <component :is="item.children[0].meta.icon"></component>
</el-icon> </el-icon>
<template #title> <template #title>
<span>{{ item.children[0].meta.title }}</span> <span v-show="!fold">{{ item.children[0].meta.title }}</span>
</template> </template>
</el-menu-item> </el-menu-item>
</template> </template>
@ -46,7 +46,7 @@
<el-icon> <el-icon>
<component :is="item.meta.icon"></component> <component :is="item.meta.icon"></component>
</el-icon> </el-icon>
<span>{{ item.meta.title }}</span> <span v-show="!fold">{{ item.meta.title }}</span>
</template> </template>
<Menu :menuList="item.children" /> <Menu :menuList="item.children" />
</el-sub-menu> </el-sub-menu>
@ -55,6 +55,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { watch, ref } from 'vue'
import useLayoutSettingStoe from '@/store/modules/setting'
const LayoutSettingStoe = useLayoutSettingStoe()
// import { onMounted, reactive, ref, toRefs, watch } from 'vue' // import { onMounted, reactive, ref, toRefs, watch } from 'vue'
// //
defineProps(['menuList']) defineProps(['menuList'])
@ -63,6 +67,15 @@ const $router = useRouter()
const goToRoute = (vc: any) => { const goToRoute = (vc: any) => {
$router.push(vc.index) $router.push(vc.index)
} }
const fold = ref(false)
watch(
() => LayoutSettingStoe.fold,
(newVal) => {
setTimeout(() => {
fold.value = newVal
}, 200)
},
)
</script> </script>
<script lang="ts"> <script lang="ts">
export default { export default {

@ -31,7 +31,3 @@ app.use(ElementPlus, {
app.use(router) app.use(router)
// 将应用挂在到挂载点上 // 将应用挂在到挂载点上
app.mount('#app') app.mount('#app')
import '@/store/modules/permission'
console.log(1111111111)

@ -10,7 +10,6 @@ const userStore = useUserStore(pinia)
const usePermissionStore = permissionStore(pinia) const usePermissionStore = permissionStore(pinia)
// const whitelist = ['/login', '/404'] // const whitelist = ['/login', '/404']
router.beforeEach(async (to, form, next) => { router.beforeEach(async (to, form, next) => {
console.log(router.getRoutes(), 'getRoutes')
// 进度条开始\ // 进度条开始\
nprogress.configure({ showSpinner: false }) nprogress.configure({ showSpinner: false })
nprogress.start() nprogress.start()
@ -31,7 +30,6 @@ router.beforeEach(async (to, form, next) => {
const asyncRouter = await usePermissionStore.getAsyncRoutes( const asyncRouter = await usePermissionStore.getAsyncRoutes(
userStore.routes, userStore.routes,
) )
console.log(asyncRouter, userStore.routes)
// 遍历筛选出来的路由通过addRoute添加到路由表 // 遍历筛选出来的路由通过addRoute添加到路由表
asyncRouter.forEach((item: any) => { asyncRouter.forEach((item: any) => {
router.addRoute(item) router.addRoute(item)
@ -68,7 +66,6 @@ router.beforeEach(async (to, form, next) => {
}) })
router.afterEach((to, form, next) => { router.afterEach((to, form, next) => {
console.log(to, form, next)
nprogress.done() nprogress.done()
}) })
export default router export default router

@ -1,6 +1,6 @@
// 用于项目logo 标题配置 // 用于项目logo 标题配置
export default { export default {
title: '教学一体化', //项目标题 title: '教学一体化后台', //项目标题
logo: '/public/logo.png', //项目logo logo: '/public/vite.svg', //项目logo
logoHidden: true, // logo隐藏设置 logoHidden: true, // logo隐藏设置
} }

@ -11,4 +11,4 @@ $base-tabbar-height:50px;
// 左侧菜单logo高度 // 左侧菜单logo高度
$base-menu-logo-height:50px; $base-menu-logo-height:50px;
// 左侧菜单标题文字大小 // 左侧菜单标题文字大小
$base-menu-logo-title-size:20px; $base-menu-logo-title-size:20px;

@ -1,6 +1,6 @@
<template> <template>
<div>home</div> <div>home</div>
<!-- <svg-icon name="home" width="300px" height="300px" color="pink"></svg-icon> --> <svg-icon name="count" width="300px" height="300px" color="pink"></svg-icon>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

Loading…
Cancel
Save