element-plus/docs/examples/switch/text-description.vue
RealityBoy 516d49f4d5
docs(components): [switch] support add multiple content example (#10783)
* docs(components): [switch] support add multiple content example

* docs: add ellipsis example
2022-11-26 13:53:03 +08:00

59 lines
1.2 KiB
Vue

<template>
<el-switch
v-model="value1"
class="mb-2"
active-text="Pay by month"
inactive-text="Pay by year"
/>
<br />
<el-switch
v-model="value2"
class="mb-2"
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
active-text="Pay by month"
inactive-text="Pay by year"
/>
<br />
<el-switch
v-model="value3"
inline-prompt
active-text=""
inactive-text=""
/>
<el-switch
v-model="value4"
class="ml-2"
inline-prompt
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
active-text="Y"
inactive-text="N"
/>
<el-switch
v-model="value6"
class="ml-2"
width="60"
inline-prompt
active-text="超出省略"
inactive-text="超出省略"
/>
<el-switch
v-model="value5"
class="ml-2"
inline-prompt
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
active-text="完整展示多个内容"
inactive-text="多个内容"
/>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const value1 = ref(true)
const value2 = ref(true)
const value3 = ref(true)
const value4 = ref(true)
const value5 = ref(true)
const value6 = ref(true)
</script>