vue-router之to属性赋值
to属性赋值 <!-- html --> <div id="app"> <router-link to="/bj/朝阳区">北京</router-link> <!-- 常规 --> <router-link to="/sh">上海-常规</router-link> <!-- 变量 --> <router-link :to="path">上海-变量</router-link> <!-- 对象path --> <router-link :to="{path:'/sh'}">上海-对象path</router-link> <!-- 对象name --> <router-link :to="{name:'b'}">上海-对象name</router-link> <!-- 对象name传值 --> <router-link :to="{name:'a', params:{placename:'丰台区'}}">北京-对象name传值</router-link> <router-view></router-view> </div> <!-- js --> <script src="./vue.js"></script> <script src="./vue-router.js"></script> <script> var router = new VueRouter({ routes: [ {