スライダーコントロールを追加するなど

This commit is contained in:
syuilo
2018-08-04 11:24:15 +09:00
parent ee050cc37e
commit 33d3d5c570
2 changed files with 38 additions and 11 deletions

View File

@ -53,7 +53,7 @@
</div>
</div>
<div class="card" v-if="form">
<div class="card form" v-if="form">
<header>
<span>%i18n:@settings-of-the-bot%</span>
</header>
@ -65,7 +65,7 @@
:key="message.id"/>
<template v-for="item in form">
<mk-switch v-if="item.type == 'button'" 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($event, item)">{{ item.desc || '' }}</mk-switch>
<div class="card" v-if="item.type == 'radio'" :key="item.id">
<header>
@ -77,6 +77,16 @@
</div>
</div>
<div class="card" v-if="item.type == 'slider'" :key="item.id">
<header>
<span>{{ item.label }}</span>
</header>
<div>
<input type="range" :min="item.min" :max="item.max" :step="item.step || 1" v-model="item.value" @change="onChangeForm($event, item)"/>
</div>
</div>
<div class="card" v-if="item.type == 'textbox'" :key="item.id">
<header>
<span>{{ item.label }}</span>
@ -214,7 +224,7 @@ export default Vue.extend({
this.connection.send({
type: 'update-form',
id: item.id,
value: v
value: item.value
});
},
@ -312,6 +322,14 @@ root(isDark)
&[data-none]
border-color transparent
&.form
> div
> .card + .card
margin-top 16px
input[type='range']
width 100%
.card
max-width 400px
border-radius 4px