vue中父组件触发子组件的方法
1. 在子组件(checkTree)中定义以下方法:
getCheckedNodes(authoId) {.....}
2. 在父组件中:父组件引用子组件(ref)
<checkTree :options="userOptions" ref="treeChild"
:props="defaultProps" @getNodeArr="getNodeArr(arguments)">
</checkTree>
js中,通过ref引用触发子组件方法:
this.$refs.treeChild.getCheckedNodes(authoId)