vue3.0中使用ref,并且调用elementPlus里面的tree树形组件里面的getCheckedNodes方法
<el-treeref="treeRef":data="nameList":props="defaultProps"show-checkbox:default-expand-all="false"v-if="contro"/><script lang="ts">import { defineComponent, reactive, toRefs, watch, ref, R
·
<el-tree
ref="treeRef"
:data="nameList"
:props="defaultProps"
show-checkbox
:default-expand-all="false"
v-if="contro"
/>
<script lang="ts">
import { defineComponent, reactive, toRefs, watch, ref, Ref } from 'vue';
setup(props, { emit }) {
const treeRef: Ref = ref(null);
function dataDetermination() {
let nameListHandle: Array<any> = treeRef.value.getCheckedNodes();
return {
treeRef,
...toRefs(state),
更多推荐
已为社区贡献2条内容
所有评论(0)