1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-17 16:18:23 +09:00
MisskeyIO/src/client/components/page/page.radio-button.vue

37 lines
561 B
Vue
Raw Normal View History

2019-07-10 18:30:51 +09:00
<template>
<div>
2020-04-20 21:35:27 +09:00
<div>{{ hpml.interpolate(value.title) }}</div>
<mk-radio v-for="x in value.values" v-model="v" :value="x" :key="x">{{ x }}</mk-radio>
2019-07-10 18:30:51 +09:00
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import MkRadio from '../ui/radio.vue';
2019-07-10 18:30:51 +09:00
export default Vue.extend({
components: {
MkRadio
},
2019-07-10 18:30:51 +09:00
props: {
value: {
required: true
},
2020-04-20 21:35:27 +09:00
hpml: {
2019-07-10 18:30:51 +09:00
required: true
}
},
data() {
return {
v: this.value.default,
};
},
watch: {
v() {
2020-04-20 21:35:27 +09:00
this.hpml.updatePageVar(this.value.name, this.v);
this.hpml.eval();
2019-07-10 18:30:51 +09:00
}
}
});
</script>