2019-07-10 09:30:51 +00:00
|
|
|
<template>
|
|
|
|
<x-container @remove="() => $emit('remove')" :draggable="true">
|
2020-01-29 19:37:25 +00:00
|
|
|
<template #header><fa :icon="faBolt"/> {{ $t('_pages.blocks.radioButton') }}</template>
|
2019-07-10 09:30:51 +00:00
|
|
|
|
|
|
|
<section style="padding: 0 16px 16px 16px;">
|
2020-07-24 16:56:52 +00:00
|
|
|
<mk-input v-model="value.name"><template #prefix><fa :icon="faMagic"/></template><span>{{ $t('_pages.blocks._radioButton.name') }}</span></mk-input>
|
|
|
|
<mk-input v-model="value.title"><span>{{ $t('_pages.blocks._radioButton.title') }}</span></mk-input>
|
|
|
|
<mk-textarea v-model="values"><span>{{ $t('_pages.blocks._radioButton.values') }}</span></mk-textarea>
|
|
|
|
<mk-input v-model="value.default"><span>{{ $t('_pages.blocks._radioButton.default') }}</span></mk-input>
|
2019-07-10 09:30:51 +00:00
|
|
|
</section>
|
|
|
|
</x-container>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import { faBolt, faMagic } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
import XContainer from '../page-editor.container.vue';
|
2020-01-29 19:37:25 +00:00
|
|
|
import MkTextarea from '../../../components/ui/textarea.vue';
|
|
|
|
import MkInput from '../../../components/ui/input.vue';
|
2019-07-10 09:30:51 +00:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
components: {
|
2020-01-29 19:37:25 +00:00
|
|
|
XContainer, MkTextarea, MkInput
|
2019-07-10 09:30:51 +00:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
value: {
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
values: '',
|
|
|
|
faBolt, faMagic
|
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
values() {
|
|
|
|
Vue.set(this.value, 'values', this.values.split('\n'));
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
if (this.value.name == null) Vue.set(this.value, 'name', '');
|
|
|
|
if (this.value.title == null) Vue.set(this.value, 'title', '');
|
|
|
|
if (this.value.values == null) Vue.set(this.value, 'values', []);
|
|
|
|
this.values = this.value.values.join('\n');
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|