Skip to content

Commit

Permalink
fix: expose tree information in the event close #315
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Mar 2, 2021
1 parent 72b42d7 commit b6bb816
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/components/Tree/src/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<script lang="tsx">
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 { TreeIcon } from './TreeIcon';
// import { DownOutlined } from '@ant-design/icons-vue';
Expand Down Expand Up @@ -77,9 +86,8 @@
state.selectedKeys = v;
emit('update:selectedKeys', v);
},
onCheck: (v: CheckKeys, e) => {
onCheck: (v: CheckKeys) => {
state.checkedKeys = v;
console.log(e);
emit('update:value', v);
},
onRightClick: handleRightClick,
Expand Down Expand Up @@ -128,7 +136,7 @@
const propsData = omit(item, 'title');
const icon = getIcon({ ...item, level }, item.icon);
return (
<Tree.TreeNode {...propsData} key={get(item, keyField)}>
<Tree.TreeNode {...propsData} node={toRaw(item)} key={get(item, keyField)}>
{{
title: () => (
<span class={`${prefixCls}-title`}>
Expand Down

0 comments on commit b6bb816

Please sign in to comment.