master
May B. 2019-06-11 11:52:44 +02:00
parent cd19aa864f
commit 19fe6973b2
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,29 @@
<template lang="pug">
extends model
block input
input(:id="id" ref="input" type="checkbox" :checked="value" @change.stop="handleChange")
</template>
<script lang="ts">
import { Component, Prop } from 'vue-property-decorator'
import BaseSetting from './BaseSetting'
@Component
export default class SettingHeritBoolean extends BaseSetting {
@Prop(Boolean)
readonly value!: boolean | undefined
mounted () {
const input: any = this.$refs.input
input.indeterminate = this.value === undefined
}
handleChange() {
this.sendChange(this.value === false ? undefined : !this.value)
}
}
</script>

View File

@ -2,13 +2,14 @@ import { Component, Prop, Watch } from 'vue-property-decorator'
import { Auth } from '@/types/App'
import SettingBoolean from '../input/SettingBoolean.vue'
import SettingHeritBoolean from '../input/SettingHeritBoolean.vue'
import SettingInt from '../input/SettingInt.vue'
import SettingSelect from '../input/SettingSelect.vue'
import SettingString from '../input/SettingString.vue'
import ServiceEmiter from '../ServiceEmiter'
import ServiceHeader from '../ServiceHeader.vue'
@Component({ components: { ServiceHeader, SettingString, SettingInt, SettingBoolean, SettingSelect } })
@Component({ components: { ServiceHeader, SettingString, SettingInt, SettingBoolean, SettingHeritBoolean, SettingSelect } })
export default class BaseService extends ServiceEmiter {
@Prop({