Vue指令——v-bind学习总结

首先在Vue实例data中编写好我们需要的数据
Vue指令——v-bind学习总结
在渲染里面写一个<input type="button" title="mytitle">
Vue指令——v-bind学习总结
不能获取vue实例中的数据值,当使用<input type="button" v-bind:title="mytitle">就可以将Vue实例中的值作为变量赋值给相关属性,Vue指令——v-bind学习总结
而v-bind可以将属性值编译成js代码执行,如
Vue指令——v-bind学习总结
Vue指令——v-bind学习总结
其简写形式为:如<input type="button" v-bind:title="mytitle">可以简写为<input type="button" :title="mytitle">

相关文章:

猜你喜欢
相关资源
相似解决方案