Files
opencloud/ui/components/settings/SettingBoolean.vue
Benedikt Kulmann ac67fee09a Add multi choice list support and fix single choice list
single choice list now
- uses raw radio input instead of the one from ODS because it's broken
- implements default value selection if no value is set
2020-04-23 19:49:40 +02:00

45 lines
841 B
Vue

<template>
<div>
<oc-checkbox v-model="value" :label="setting.boolValue.label" />
</div>
</template>
<script>
export default {
name: 'SettingBoolean',
props: {
bundle: {
type: Object,
required: true
},
setting: {
type: Object,
required: true
}
},
data() {
return {
initialValue: null,
value: null
}
},
computed: {
isChanged() {
return this.initialValue !== this.value
}
},
methods: {
applyValue() {
// TODO: propagate value to parent
// TODO: show a spinner while the request for saving the value is running!
}
},
mounted() {
// TODO: load the settings value of the authenticated user and apply it to the value
if (this.value === null) {
this.value = this.setting.boolValue.default
}
}
}
</script>