mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 01:41:20 +08:00
1aa9d43129
1. Use CSS variables to set `(in)activeColor` in order not to modify DOM 2. Deprecate property `(in)activeColor` in favor of CSS variables
16 lines
299 B
Vue
16 lines
299 B
Vue
<template>
|
|
<el-switch v-model="value1" />
|
|
<el-switch
|
|
v-model="value2"
|
|
class="ml-2"
|
|
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
|
/>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref } from 'vue'
|
|
|
|
const value1 = ref(true)
|
|
const value2 = ref(true)
|
|
</script>
|