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,7 +16,8 @@
name: 'ch-select',
props:[
'title',
'list'
'list',
'parentData'
],
data() {
return {
@@ -25,8 +26,12 @@
},
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>