blob: 1bf1ba165ff27fc7562f6af45d9acd735281d972 [file] [log] [blame]
<template>
<div class="control-boolean">
<el-switch v-model="innerValue" :active-text="$t('example.booleanDesc')" @change="onValueChange"></el-switch>
</div>
</template>
<script>
export default {
props: ['value'],
data() {
return {
innerValue: this.value === 'true'
}
},
watch: {
value(val) {
this.innerValue = val;
}
},
methods: {
onValueChange() {
this.$emit('change', this.innerValue);
}
}
}
</script>
<style lang="scss">
</style>