1234567891011121314151617181920212223242526272829303132333435363738 |
- <template>
- <div class="station-switch">
- <el-switch
- v-model="flag"
- size="default"
- style="--el-switch-on-color: #ac014d; --el-switch-off-color: #b1b1b1"
- @change="
- (val: number) => {
- emit('update:flag', val)
- }
- "
- />
- <span class="switch-label">{{ label }}</span>
- </div>
- </template>
- <script setup lang="ts">
- const props = defineProps({
- flag: {
- type: Boolean,
- required: true,
- },
- label: {
- type: String,
- },
- })
- const emit = defineEmits(['update:flag'])
- </script>
- <style scoped lang="scss">
- .station-switch {
- height: 32px;
- .switch-label {
- padding-left: 4px;
- line-height: 32px;
- }
- }
- </style>
|