Herit
This commit is contained in:
parent
cd19aa864f
commit
19fe6973b2
|
@ -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>
|
|
@ -2,13 +2,14 @@ import { Component, Prop, Watch } from 'vue-property-decorator'
|
||||||
|
|
||||||
import { Auth } from '@/types/App'
|
import { Auth } from '@/types/App'
|
||||||
import SettingBoolean from '../input/SettingBoolean.vue'
|
import SettingBoolean from '../input/SettingBoolean.vue'
|
||||||
|
import SettingHeritBoolean from '../input/SettingHeritBoolean.vue'
|
||||||
import SettingInt from '../input/SettingInt.vue'
|
import SettingInt from '../input/SettingInt.vue'
|
||||||
import SettingSelect from '../input/SettingSelect.vue'
|
import SettingSelect from '../input/SettingSelect.vue'
|
||||||
import SettingString from '../input/SettingString.vue'
|
import SettingString from '../input/SettingString.vue'
|
||||||
import ServiceEmiter from '../ServiceEmiter'
|
import ServiceEmiter from '../ServiceEmiter'
|
||||||
import ServiceHeader from '../ServiceHeader.vue'
|
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 {
|
export default class BaseService extends ServiceEmiter {
|
||||||
|
|
||||||
@Prop({
|
@Prop({
|
||||||
|
|
Loading…
Reference in New Issue