vue 使用记录
1.路径:http://localhost:8081/#/test?name=1
使用:this.$route.query.id
2.路径:http://localhost:8081/#/test/1
{
path: '/test/:id',
name: 'Test',
component: require('./component/Test.vue')
}
使用:this.$route.params.id
this.$route是一个数组,里面包含路由的所有信息
注意:router-link中链接如果是‘/’开始就是从根路由开始,如果开始不带‘/’,则从当前路由开始
3. ## vue 删除一行数据
data: {
todos : [ {},{}]
}
methods : {
doM: function(id,index){
this.todos.splice(index,1)
}
}
4. 在 option 选择框中, value 要绑定属性,@bind:value or :value
1



