ElementUI - 调用组件中提供的方法
前言
在使用ElementUI的tree组件时,tree组件提供相应的方法,这是在使用iviewUI中所没有的
使用方法
<template>
<el-tree
ref="tree"
:data="data"
:props="defaultProps"
accordion
@node-click="handleNodeClick">
</el-tree>
</template>
<script>
export default {
name: '',
methods: {
methods () {
// 返回目前被选中的节点所组成的数组
this.$refs.tree.getCheckedNodes()
}
}
}
</script>
还没有评论,来说两句吧...