本文共 431 字,大约阅读时间需要 1 分钟。
1.class和style
概念:模板界面中(template),某些元素的样式是变化的,class/style用于动态绑定类和样式class/style绑定技术就是专门用来处理动态样式效果。 class样式::class = 'aaa'
,其中aaa是取值,可以是字符串、对象、数组。 style样式::style = "{backgroundColor:bgcolor,fontSize:fSize}"
(这个觉得单词拼错了!),其中bgColor和fSize都是data属性! 默认:<template><div id="app"></div></template>
新建组件:ClassAndStyle.vue,组件是面向全局的。 //字符串 //对象,直接用style中的名字。 //数组 //style
转载地址:http://fejv.baihongyu.com/