to wayt bindig of parent and child

This commit is contained in:
ori agranat
2019-03-26 21:05:01 +02:00
parent 8dee0e1ba7
commit ae5c927d1f
6 changed files with 28 additions and 18 deletions

View File

@@ -16,16 +16,20 @@
<script>
export default {
name: 'ch-slider',
props:['title','value'],
props:['title','parentData'],
data() {
return {
content:this.value
value:0,
}
},
methods: {
handleInput() {
this.$emit('input',{[this.title]:this.value});
this.$emit('input',this.value);
this.$socket.sendObj({[this.title]:this.value});
}
},
beforeMount () {
this.value = this.parentData
}
}
</script>