element-plus/docs/examples/switch/custom-icons.vue
Aex cd646824c2
feat(components): el-switch add inline content support (#4091)
* refactor(components): el-swtich custom texts and icons

* fix: test

* fix: font size

* fix: example margin

* feat(components): el-switch add inline-prompt support

* revert: paly

* docs: update icons

* feat: add inner text

* fix: switch test

* refactor: icon inline
2021-10-30 21:23:29 +08:00

28 lines
502 B
Vue

<template>
<el-switch v-model="value1" :active-icon="active" :inactive-icon="inactive">
</el-switch>
<br />
<el-switch
v-model="value2"
style="margin-left: 24px"
inline-prompt
:active-icon="active"
:inactive-icon="inactive"
>
</el-switch>
</template>
<script lang="ts">
import { Check, Close } from '@element-plus/icons'
export default {
data() {
return {
value1: true,
value2: true,
active: Check,
inactive: Close,
}
},
}
</script>