标签跳转
to:导航路径
1 | <p>导航 : |
JS代码内跳转
1 | this.$router.push('/xxx') |
具体简单用法:
- 先编写一个按钮,在按钮上绑定
goHome方法
1 | <button @click='goHome'>回到首页</button> |
- 在
<script>模块的methods里加入goHome方法,并用this.$router.push('/')导航到首页
1 | export default { |
其他
1 | // 后退一步记录,等同于 history.back() |