VueJS:以冒号为前缀的 html 属性表示什么?
VueJS: what does an html attribute prefixed with a colon signify?
示例:
<vue-select
class="vue-select1"
name="select1"
:options="options1"
:model.sync="result1"
></vue-select>
这里:options
和:model.sync
前面的冒号是什么意思?我在整个互联网上搜索过,但找不到任何答案。
在 Vue 模板中,html 属性前的冒号 :
是 shorthand for v-bind
.
添加到:
那些是dynamic attributes。基本上就是说Vue.js会让你把那些属性的值设置为变量,当那些变量的值更新时,那些属性的值也会更新。
在HTML
中使用冒号时要小心,因为在CSS
和JQuery
中选择属性与冒号具有不同的含义。在CSS
和JQuery
中,冒号表示pseudo-selector
,与v-bind
;
不同
示例:
<vue-select
class="vue-select1"
name="select1"
:options="options1"
:model.sync="result1"
></vue-select>
这里:options
和:model.sync
前面的冒号是什么意思?我在整个互联网上搜索过,但找不到任何答案。
在 Vue 模板中,html 属性前的冒号 :
是 shorthand for v-bind
.
添加到
那些是dynamic attributes。基本上就是说Vue.js会让你把那些属性的值设置为变量,当那些变量的值更新时,那些属性的值也会更新。
在HTML
中使用冒号时要小心,因为在CSS
和JQuery
中选择属性与冒号具有不同的含义。在CSS
和JQuery
中,冒号表示pseudo-selector
,与v-bind
;