为什么vue组件的属性,有的需要加冒号“:”,有的不用?

加冒号的,说明后面的是一个变量或者表达式;没加冒号的后面就是对应的字符串字面量。

如:

<my-progress :stroke-width="18" :percentage="30" mycolor="orange" status='exception' :text-inside="true" />

 

status和mycolor均为字符串的字面量   而其他的属性不是number就是bool

posted @ 2019-11-29 15:41  狂奔的胖切肯  阅读(523)  评论(0编辑  收藏  举报