mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-30 11:16:12 +08:00
refactor(docs): add spacing for switch example (#5092)
This commit is contained in:
parent
2f146e8624
commit
59759c9546
@ -7,14 +7,6 @@ lang: en-US
|
||||
|
||||
Switch is used for switching between two opposing states.
|
||||
|
||||
<style lang="scss">
|
||||
.example-showcase {
|
||||
.el-switch + .el-switch {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
## Basic usage
|
||||
|
||||
:::demo Bind `v-model` to a `Boolean` typed variable. The `active-color` and `inactive-color` attribute decides the background color in two states.
|
||||
|
@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<el-switch v-model="value1" />
|
||||
<el-switch v-model="value2" active-color="#13ce66" inactive-color="#ff4949" />
|
||||
<el-switch
|
||||
v-model="value2"
|
||||
class="ml-2"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
@ -4,6 +4,7 @@
|
||||
<br />
|
||||
<el-switch
|
||||
v-model="value2"
|
||||
class="mt-2"
|
||||
style="margin-left: 24px"
|
||||
inline-prompt
|
||||
:active-icon="Check"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-switch v-model="value1" disabled />
|
||||
<el-switch v-model="value2" />
|
||||
<el-switch v-model="value2" class="ml-2" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-switch v-model="value1" loading />
|
||||
<el-switch v-model="value2" loading />
|
||||
<el-switch v-model="value2" loading class="ml-2" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
@ -6,6 +6,7 @@
|
||||
/>
|
||||
<el-switch
|
||||
v-model="value2"
|
||||
class="ml-2"
|
||||
:loading="loading2"
|
||||
:before-change="beforeChange2"
|
||||
/>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<el-switch
|
||||
v-model="value1"
|
||||
class="mb-2"
|
||||
active-text="Pay by month"
|
||||
inactive-text="Pay by year"
|
||||
>
|
||||
@ -8,6 +9,7 @@
|
||||
<br />
|
||||
<el-switch
|
||||
v-model="value2"
|
||||
class="mb-2"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-text="Pay by month"
|
||||
@ -18,6 +20,7 @@
|
||||
</el-switch>
|
||||
<el-switch
|
||||
v-model="value4"
|
||||
class="ml-2"
|
||||
inline-prompt
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
|
@ -2,6 +2,7 @@
|
||||
<div class="demo-time-range">
|
||||
<el-time-select
|
||||
v-model="startTime"
|
||||
class="mr-4"
|
||||
placeholder="Start time"
|
||||
start="08:30"
|
||||
step="00:15"
|
||||
@ -26,9 +27,3 @@ import { ref } from 'vue'
|
||||
const startTime = ref('')
|
||||
const endTime = ref('')
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.demo-time-range .el-select {
|
||||
margin-right: 8px;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user