<template> <view> <!-- class --> <view class="static" :class="{ active: isActive}">111</view> <view class="static" :class="{ active: isActive, 'text-danger': hasError }">222</view> <!-- style --> <view v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }">333</view> </view> </template> <script> export default { data() { return { isActive: true, hasError: false, activeColor:"green", fontSize:50 } } } </script> <style> .static{ color: #2C405A; } .active{ background-color: #007AFF; } .text-danger{ color: #DD524D; } </style>
网友评论