router-view空白,同样的结构在我的其他项目里都没问题,不知道这里为什么不能显示。
目录结构如下
main.js
import Vue from 'vue'
import App from './home.vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '../../assets/reset.css'
import router from './router';
Vue.config.productionTip = false
Vue.use(ElementUI) //element
new Vue({
router,
render: h => h(App)
}).$mount('#home')
`
router.js
import Vue from 'vue'
import Router from 'vue-router'
import HelpManual from './helpManual.vue'
Vue.use(Router)
const router = new Router({
routes: [{
path: '/',
name: 'helpManual',
component: HelpManual,
}, {
path: '/about',
name: 'about',
component: () => import('./views/About.vue')
}]
})
router.beforeEach((to, from, next) => {
})
router.afterEach(route => {
})
export default router
`
home.vue
`
<template>
<div id="home">
1111
<router-view/>
</div>
</template>
<script>
export default {
name: "home",
};
</script>
<style lang="scss">
</style>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…