update
This commit is contained in:
parent
7198186a92
commit
6c121bd5c3
31
vue-qa.md
Normal file
31
vue-qa.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# 前端开发中的问题整理
|
||||||
|
|
||||||
|
|
||||||
|
1. 路由引入时,如果是动态引入,要使用方法来引入
|
||||||
|
|
||||||
|
```
|
||||||
|
import MapView from '@/views/MapView.vue'
|
||||||
|
|
||||||
|
const router = createRouter({
|
||||||
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
|
routes: [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
name: 'home',
|
||||||
|
component: MainView
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/mapView',
|
||||||
|
name: 'mapView',
|
||||||
|
component: MapView, ✅
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path:'/login',
|
||||||
|
name:'login',
|
||||||
|
// component: import('@/views/Login.vue') ❌ 有可能出bug引入文件失败
|
||||||
|
component: () => import('@/views/Login.vue') ✅
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
2
vue.md
2
vue.md
@ -171,6 +171,6 @@ import DevicePage from '@/views/device/DevicePage.vue'
|
|||||||
|
|
||||||
* ##### 路由定义每个页面必须带上meta属性,其中meta.title为页面标题,meta.icon为页面图标,meta.keepAlive为页面是否需要缓存,如:
|
* ##### 路由定义每个页面必须带上meta属性,其中meta.title为页面标题,meta.icon为页面图标,meta.keepAlive为页面是否需要缓存,如:
|
||||||
|
|
||||||
|
* ##### [开发中遇到的问题整理](./vue-qa.md)
|
||||||
|
|
||||||
* ##### 待补充
|
* ##### 待补充
|
||||||
|
Loading…
Reference in New Issue
Block a user