refactor(components): [switch] Simplify color handling (#8199)

1. Use CSS variables to set `(in)activeColor` in order not to modify DOM
2. Deprecate property `(in)activeColor` in favor of CSS variables
This commit is contained in:
Carter Li
2022-06-12 22:40:53 +08:00
committed by GitHub
parent 1702a20214
commit 1aa9d43129
7 changed files with 54 additions and 43 deletions

View File

@ -3,8 +3,7 @@
<el-switch
v-model="value2"
class="ml-2"
active-color="#13ce66"
inactive-color="#ff4949"
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
/>
</template>