v-model 用在表单标签上,实现双向绑定
v-bind 多和props,一起用,实现双向绑定
提示:若要直接传递数字、布尔值、数组、对象,而不使用v-bind的时候,传递的只是字符串:
<child-component m="[1,2]"></child-component> 其输出长度是5
<child-component :m="[1,2]"></child-component> 其长度是2
v-model 用在表单标签上,实现双向绑定
v-bind 多和props,一起用,实现双向绑定
提示:若要直接传递数字、布尔值、数组、对象,而不使用v-bind的时候,传递的只是字符串:
<child-component m="[1,2]"></child-component> 其输出长度是5
<child-component :m="[1,2]"></child-component> 其长度是2