'!'
This commit is contained in:
12
src/pagesAddress/switch-label/switch-label.scss
Normal file
12
src/pagesAddress/switch-label/switch-label.scss
Normal 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;
|
||||
}
|
||||
}
|
||||
53
src/pagesAddress/switch-label/switch-label.vue
Normal file
53
src/pagesAddress/switch-label/switch-label.vue
Normal 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>
|
||||
Reference in New Issue
Block a user