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') ✅
|
||||
},
|
||||
]
|
||||
})
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user