This commit is contained in:
syuilo 2018-08-04 11:25:39 +09:00
parent 3c9675685c
commit d28bb73059

View File

@ -65,7 +65,7 @@
:key="message.id"/> :key="message.id"/>
<template v-for="item in form"> <template v-for="item in form">
<mk-switch v-if="item.type == 'switch'" v-model="item.value" :key="item.id" :text="item.label" @change="onChangeForm($event, item)">{{ item.desc || '' }}</mk-switch> <mk-switch v-if="item.type == 'switch'" v-model="item.value" :key="item.id" :text="item.label" @change="onChangeForm(item)">{{ item.desc || '' }}</mk-switch>
<div class="card" v-if="item.type == 'radio'" :key="item.id"> <div class="card" v-if="item.type == 'radio'" :key="item.id">
<header> <header>
@ -73,7 +73,7 @@
</header> </header>
<div> <div>
<form-radio v-for="(r, i) in item.items" :key="item.id + ':' + i" v-model="item.value" :value="r.value" @change="onChangeForm($event, item)">{{ r.label }}</form-radio> <form-radio v-for="(r, i) in item.items" :key="item.id + ':' + i" v-model="item.value" :value="r.value" @change="onChangeForm(item)">{{ r.label }}</form-radio>
</div> </div>
</div> </div>
@ -83,7 +83,7 @@
</header> </header>
<div> <div>
<input type="range" :min="item.min" :max="item.max" :step="item.step || 1" v-model="item.value" @change="onChangeForm($event, item)"/> <input type="range" :min="item.min" :max="item.max" :step="item.step || 1" v-model="item.value" @change="onChangeForm(item)"/>
</div> </div>
</div> </div>
@ -93,7 +93,7 @@
</header> </header>
<div> <div>
<el-input v-model="item.value" @change="onChangeForm($event, item)"/> <el-input v-model="item.value" @change="onChangeForm(item)"/>
</div> </div>
</div> </div>
</template> </template>
@ -220,7 +220,7 @@ export default Vue.extend({
this.messages.unshift(x.message); this.messages.unshift(x.message);
}, },
onChangeForm(v, item) { onChangeForm(item) {
this.connection.send({ this.connection.send({
type: 'update-form', type: 'update-form',
id: item.id, id: item.id,