1.直接在元素上通过:style 的形式,书写样式对象
1 | <h1 :style="{color:'red','font-weight':200}">这是一个H1</h1> |
2.将样式对象定义在 data 中,并直接引用到:style 中
1 | <template> |
3.在:style 中通过数组,引用多个 data 上的样式对象
1 | <template> |
I'm so cute. Please give me money.
- Post link: https://blog.gaocaipeng.com/2020/05/23/qshb5e/
- Copyright Notice: All articles in this blog are licensed under unless otherwise stated.