• 动态class对象:
  • <div :class="{ 'is-active': true, 'red': isRed }"></div>

  • 动态class数组:
  • <div :class="['is-active', isRed ? 'red' : '' ]"></div>

  • 动态style对象:
  • <div :style="{ color: textColor, fontSize: '18px' }"></div>

  • 动态style数组:
  • <div :style="[{ color: textColor, fontSize: '18px' }, { fontWeight: '300' }]"></div>