本篇文章给大家介绍在Vue项目中如何新建一个路由页面,希望对需要的朋友有所帮助!
具体方法步骤如下:
我们现在要新建一个测试页面,命名为Test.vue
1:在components底下新建Test.vue

<template>
<div>我是测试界面</div>
</template>
<script>
</script>
<style>
</style>
<template>
<div>我是测试界面</div>
</template>
<script>
</script>
<style>
</style>
2:打开App.vue {name:'/components/Test',navItem:'测试界面'},

3:打开路由来,导入组件 index.js
import Test from '@/components/Test'
{
path: '/components/Test',
name: 'Test',
component: Test
}


就可以了。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

评论(0)