summaryrefslogtreecommitdiff
path: root/src/client/app/common/views/pages/page/page.switch.vue
blob: d36ecbfba1be124a3d911a72ab2dd6f157ad6a08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<template>
<div class="hkcxmtwj">
	<ui-switch v-model="v">{{ script.interpolate(value.text) }}</ui-switch>
</div>
</template>

<script lang="ts">
import Vue from 'vue';

export default Vue.extend({
	props: {
		value: {
			required: true
		},
		script: {
			required: true
		}
	},

	data() {
		return {
			v: this.value.default,
		};
	},

	watch: {
		v() {
			this.script.aiScript.updatePageVar(this.value.name, this.v);
			this.script.reEval();
		}
	}
});
</script>

<style lang="stylus" scoped>
.hkcxmtwj
	display inline-block
	margin 16px auto
</style>