Files
PhotonVision/chameleon-client/src/components/ch-inputNumber.vue

45 lines
1022 B
Vue
Raw Normal View History

2019-03-20 22:35:02 +02:00
<template>
<div id="InputNumber">
<row type="flex" justify="start" align="middle" :gutter="10" >
<Col span="6">
<h4>{{title}}</h4>
</Col>
<col span="4">
<InputNumber :min="0" v-model="value" size="small" @on-change="handleInput"></InputNumber>
2019-03-20 22:35:02 +02:00
</col>
</row>
</div>
</template>
<script>
export default {
name: 'ch-InputNumber',
2019-04-23 14:42:51 -07:00
props:{
title:String,
Xkey:String
},
2019-03-20 22:35:02 +02:00
data() {
return {
}
},
methods: {
handleInput() {
2019-04-23 14:42:51 -07:00
this.$socket.sendObj({[this.Xkey]:this.value});
}
},
computed:{
value:{
get: function(){
return this.$store.state[this.Xkey];
},
set: function(value){
this.$store.commit(this.Xkey,value);
}
2019-03-20 22:35:02 +02:00
}
}
}
</script>
<style lang="" scoped>
</style>