0👍
I guess you are binding this ‘sinput’ on selected tree node value, then you’ll need to use event ‘node-click’ on tree component.
For v-model on customizing component, you need ‘model’ option in vue.
ref: Vue.js – Customizing Component v-model
here’s some code, hope it would help 🙂
<template>
<el-tree
...
@node-click="handleNodeClick"
/>
</template>
export default {
model: {
prop: 'sinput',
event: 'change'
},
props: {
sinput: String
},
methods: {
handleNodeClick(data) {
if (!data.children) {
// your code
this.$emit('change', data.value);
}
}
}
}
- [Vuejs]-How can search through json data in vue?
- [Vuejs]-How can I get file object properties with a button click?
Source:stackexchange.com