소스 검색

fix(tree): ensure that the check event is emitted close #400

Vben 4 년 전
부모
커밋
16ef13477c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/components/Tree/src/index.vue

+ 2 - 1
src/components/Tree/src/index.vue

@@ -39,7 +39,7 @@
     name: 'BasicTree',
     inheritAttrs: false,
     props: basicProps,
-    emits: ['update:expandedKeys', 'update:selectedKeys', 'update:value', 'change'],
+    emits: ['update:expandedKeys', 'update:selectedKeys', 'update:value', 'change', 'check'],
     setup(props, { attrs, slots, emit }) {
       const state = reactive<State>({
         checkStrictly: props.checkStrictly,
@@ -92,6 +92,7 @@
             state.checkedKeys = v;
             const rawVal = toRaw(v);
             emit('change', rawVal);
+            emit('check', rawVal);
             emit('update:value', rawVal);
           },
           onRightClick: handleRightClick,