:style="{}"
<strong :style="{color: 'red', backgroundColor: 'gray'}"></strong>:style="a"
new Vue({
el: '#box',
data: {
red: 'red',
gray: 'gray',
a: {
color: 'red',
backgroundColor: 'gray' //注意复合样式的书写规范
}
}
});<strong :style="a">阿斯顿发</strong>
:style="[a, b]", a, b对应的是data里的两个json数据
更多vue中class和style设置的相关方法 相关文章请关注PHP中文网!
Copyright © 2019- baomayou.com 版权所有 赣ICP备2024042794号-6
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务