chaihongjun.me

[Vue]入门学习之三Vue的属性绑定

通过示例可以看出文本渲染的语法{{}}无法使用在HTML元素的属性上,无法解析,

QQ截图20181101104251.png

并且Vue报错:

href="{{website}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.

中文翻译,属性插值被删除了,使用v-bind或者缩写方式代替。

v-bind的缩写方法就是只保留冒号.

 

知识共享许可协议本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议进行许可。作者:柴宏俊»