1、进入demo-project项目的src\components目录下新建views目录,并新建Second.vue组件

2、编辑First.vue组件,在中增加一段代码:
<template>
<div class="first-app">
{{msg}}
<confirm text="注册" @message="getMessage"></confirm>
<p><router-link to="/second">跳转至第二个页面</router-link> </p>
</div>
</template>

页面展示效果:

3、编辑Second.vue组件

4、编辑index.js文件

界面展示效果:

注:学习更多路由请看官方文档https://router.vuejs.org/zh/

被折叠的 条评论
为什么被折叠?



