如果组件通过query来传递num参数为1,相当与在 url 地址后面拼接参数

<template>  
<div>
<h3>首页</h3>
<router-link :to="{ path:'/home/chee', query: { num: 1} }">
<button>点击<tton>
</router-link>
<router-view></router-view>
</div>
</template>

这是子路由中通过 this.$route.query.num 来显示传递过来的参数URL显示(http://localhost:8080/#/home/chee?num=1)

<template>  
<h3>农药王者{{ this.$route.query.num }}</h3>
</template>