1.修复了route不能在App.vue中正常显示的bug
2.精简了App.vue,重构了HelloWorld.vue 3.在route/index.js中留了个小彩蛋 4.添加了一些提示语
This commit is contained in:
parent
e8e794e9d4
commit
83bc094502
34
src/App.vue
34
src/App.vue
@ -1,30 +1,10 @@
|
|||||||
<script setup>
|
|
||||||
import HelloWorld from './components/HelloWorld.vue'
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<router-view></router-view>
|
||||||
<a href="https://vitejs.dev" target="_blank">
|
|
||||||
<img src="/vite.svg" class="logo" alt="Vite logo" />
|
|
||||||
</a>
|
|
||||||
<a href="https://vuejs.org/" target="_blank">
|
|
||||||
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<HelloWorld msg="Vite + Vue" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<script setup>
|
||||||
.logo {
|
import 'element-plus/dist/index.css'
|
||||||
height: 6em;
|
</script>
|
||||||
padding: 1.5em;
|
|
||||||
will-change: filter;
|
<!--请不要对App.vue进行修改,请采用在views的对应目录下新建自己需要的文件
|
||||||
transition: filter 300ms;
|
并通过在/router下的对应模块名称的js中引入路由的方式来显示自己的页面-->
|
||||||
}
|
|
||||||
.logo:hover {
|
|
||||||
filter: drop-shadow(0 0 2em #646cffaa);
|
|
||||||
}
|
|
||||||
.logo.vue:hover {
|
|
||||||
filter: drop-shadow(0 0 2em #42b883aa);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@ -1,17 +1,19 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import 'element-plus/dist/index.css'
|
|
||||||
|
|
||||||
|
|
||||||
defineProps({
|
|
||||||
msg: String,
|
|
||||||
})
|
|
||||||
|
|
||||||
const count = ref(0)
|
const count = ref(0)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<h1>{{ msg }}</h1>
|
<div>
|
||||||
|
<a href="https://vitejs.dev" target="_blank">
|
||||||
|
<img src="/vite.svg" class="logo" alt="Vite logo" />
|
||||||
|
</a>
|
||||||
|
<a href="https://vuejs.org/" target="_blank">
|
||||||
|
<img src="../assets/vue.svg" class="logo vue" alt="Vue logo" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<h1>{{ this.$route.meta.msg }}</h1>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<el-button type="success" @click="count++">count is {{ count }}</el-button>
|
<el-button type="success" @click="count++">count is {{ count }}</el-button>
|
||||||
@ -39,6 +41,18 @@ const count = ref(0)
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.logo {
|
||||||
|
height: 6em;
|
||||||
|
padding: 1.5em;
|
||||||
|
will-change: filter;
|
||||||
|
transition: filter 300ms;
|
||||||
|
}
|
||||||
|
.logo:hover {
|
||||||
|
filter: drop-shadow(0 0 2em #646cffaa);
|
||||||
|
}
|
||||||
|
.logo.vue:hover {
|
||||||
|
filter: drop-shadow(0 0 2em #42b883aa);
|
||||||
|
}
|
||||||
.read-the-docs {
|
.read-the-docs {
|
||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,8 +7,10 @@ import newsManagementRoutes from './newsManagement'
|
|||||||
import organizationManagementRoutes from './organizationManagement'
|
import organizationManagementRoutes from './organizationManagement'
|
||||||
import userManagementRoutes from './userManagement'
|
import userManagementRoutes from './userManagement'
|
||||||
|
|
||||||
|
// 请不要直接修改本文件,使用在router下的对应模块名称的js中引入路由的方式来代替->
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{ path: '/', component: HelloWorld },
|
{ path: '/', component: HelloWorld, meta: {"msg": "HeIl⚪ W0rId!"}},
|
||||||
...authenticationRoutes,
|
...authenticationRoutes,
|
||||||
...courseManagementRoutes,
|
...courseManagementRoutes,
|
||||||
...meetingManagementRoutes,
|
...meetingManagementRoutes,
|
||||||
|
|||||||
@ -6,6 +6,8 @@ import newsManagement from './newsManagement'
|
|||||||
import organizationManagement from './organizationManagement'
|
import organizationManagement from './organizationManagement'
|
||||||
import userManagement from './userManagement'
|
import userManagement from './userManagement'
|
||||||
|
|
||||||
|
// 请不要直接修改本文件,使用修改/store目录下的对应模块名称的js的方式来代替->
|
||||||
|
|
||||||
const store = createStore({
|
const store = createStore({
|
||||||
modules: {
|
modules: {
|
||||||
authentication,
|
authentication,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user