summaryrefslogtreecommitdiff
path: root/src/client/app/common/views/components/page/page.switch.vue
blob: 53695f1b36760202fb5f4bec98bde070e9b94308 (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
40
41
42
43
<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.eval();
		}
	}
});
</script>

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

	& + .hkcxmtwj
		margin-left 16px

</style>