样式class:
静态选择器
数组
对象

  • class数组写法: ```html
  1. ![image.png](https://cdn.nlark.com/yuque/0/2020/png/1511608/1591026104971-324c41dd-f8f4-4053-9bc5-f5bead68776a.png#align=left&display=inline&height=729&margin=%5Bobject%20Object%5D&name=image.png&originHeight=729&originWidth=613&size=46087&status=done&style=none&width=613)
  2. - class对象写法:
  3. ```html
  4. <view :class="{'content':content}">
  5. <image class="logo" src="/static/logo.png"></image>
  6. <view class="text-area">
  7. <text class="title">{{title}}</text>
  8. </view>
  9. </view>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. title: 'Hello',
  15. content:true,
  16. backagound:'backagound'
  17. }
  18. },
  19. methods: {
  20. }
  21. }
  22. </script>

image.png

style

同样有三种方法:

  • 对象
  • 数组
  • 静态绑定