fix: expose tree information in the event close #315
This commit is contained in:
parent
72b42d7b35
commit
b6bb81630d
|
|
@ -1,7 +1,16 @@
|
||||||
<script lang="tsx">
|
<script lang="tsx">
|
||||||
import type { ReplaceFields, Keys, CheckKeys, TreeActionType, TreeItem } from './types';
|
import type { ReplaceFields, Keys, CheckKeys, TreeActionType, TreeItem } from './types';
|
||||||
|
|
||||||
import { defineComponent, reactive, computed, unref, ref, watchEffect, onMounted } from 'vue';
|
import {
|
||||||
|
defineComponent,
|
||||||
|
reactive,
|
||||||
|
computed,
|
||||||
|
unref,
|
||||||
|
ref,
|
||||||
|
watchEffect,
|
||||||
|
onMounted,
|
||||||
|
toRaw,
|
||||||
|
} from 'vue';
|
||||||
import { Tree } from 'ant-design-vue';
|
import { Tree } from 'ant-design-vue';
|
||||||
import { TreeIcon } from './TreeIcon';
|
import { TreeIcon } from './TreeIcon';
|
||||||
// import { DownOutlined } from '@ant-design/icons-vue';
|
// import { DownOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
@ -77,9 +86,8 @@
|
||||||
state.selectedKeys = v;
|
state.selectedKeys = v;
|
||||||
emit('update:selectedKeys', v);
|
emit('update:selectedKeys', v);
|
||||||
},
|
},
|
||||||
onCheck: (v: CheckKeys, e) => {
|
onCheck: (v: CheckKeys) => {
|
||||||
state.checkedKeys = v;
|
state.checkedKeys = v;
|
||||||
console.log(e);
|
|
||||||
emit('update:value', v);
|
emit('update:value', v);
|
||||||
},
|
},
|
||||||
onRightClick: handleRightClick,
|
onRightClick: handleRightClick,
|
||||||
|
|
@ -128,7 +136,7 @@
|
||||||
const propsData = omit(item, 'title');
|
const propsData = omit(item, 'title');
|
||||||
const icon = getIcon({ ...item, level }, item.icon);
|
const icon = getIcon({ ...item, level }, item.icon);
|
||||||
return (
|
return (
|
||||||
<Tree.TreeNode {...propsData} key={get(item, keyField)}>
|
<Tree.TreeNode {...propsData} node={toRaw(item)} key={get(item, keyField)}>
|
||||||
{{
|
{{
|
||||||
title: () => (
|
title: () => (
|
||||||
<span class={`${prefixCls}-title`}>
|
<span class={`${prefixCls}-title`}>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue