This commit is contained in:
wtq
2025-11-28 10:19:58 +08:00
commit 3e6f452aa5
275 changed files with 47800 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
@import '@/assets/bundle.scss';
.switch-label {
@extend %flex-left;
height: 100rpx;
.label {
width: 240rpx;
flex: none;
font-size: 30rpx;
color: $text1;
}
}

View File

@@ -0,0 +1,53 @@
<template>
<div class="switch-label">
<div class="label">{{label}}</div>
<y-switch
v-model:value="currentValue"
@on-change="onChange"
:size="size"
></y-switch>
</div>
</template>
<script>
import YSwitch from '../Switch/switch'
export default {
components: {
YSwitch
},
props: {
label: {
type: String,
default: ''
},
value: {
type: Boolean,
default: false
},
size: {
type: String,
default: '50'
}
},
data () {
return {
currentValue: this.value
}
},
watch: {
value (val) {
this.currentValue = val
}
},
methods: {
onChange (val) {
this.currentValue = val
this.$emit('update:value',val)
}
}
}
</script>
<style lang="scss">
@import "./switch-label.scss";
</style>