perf: update tree
parent
3d17d5f26e
commit
d57a2acd87
|
@ -1 +1 @@
|
|||
Subproject commit 83ab203d1ab9861132f6efd1e74015507c0e45f6
|
||||
Subproject commit 5a00801c5012248ce32d8ed7a4164da3a5fde90f
|
|
@ -4,6 +4,7 @@ import warning from 'warning';
|
|||
import { hasProp, initDefaultProps, getOptionProps, getSlot } from '../../_util/props-util';
|
||||
import { cloneElement } from '../../_util/vnode';
|
||||
import BaseMixin from '../../_util/BaseMixin';
|
||||
import syncWatch from '../../_util/syncWatch';
|
||||
import {
|
||||
convertTreeToEntities,
|
||||
convertDataToTree,
|
||||
|
@ -30,8 +31,11 @@ import {
|
|||
function getWatch(keys = []) {
|
||||
const watch = {};
|
||||
keys.forEach(k => {
|
||||
watch[k] = function() {
|
||||
this.needSyncKeys[k] = true;
|
||||
watch[k] = {
|
||||
handler() {
|
||||
this.needSyncKeys[k] = true;
|
||||
},
|
||||
flush: 'sync',
|
||||
};
|
||||
});
|
||||
return watch;
|
||||
|
@ -149,10 +153,10 @@ const Tree = {
|
|||
'checkedKeys',
|
||||
'loadedKeys',
|
||||
]),
|
||||
__propsSymbol__() {
|
||||
__propsSymbol__: syncWatch(function() {
|
||||
this.setState(this.getDerivedState(getOptionProps(this), this.$data));
|
||||
this.needSyncKeys = {};
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
@ -15,7 +15,7 @@ Use Drawer to quickly preview details of an object, such as those in a list.
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import demo from '../antdv-demo/docs/transfer/demo/basic.md';
|
||||
import demo from '../antdv-demo/docs/tree/demo';
|
||||
export default {
|
||||
components: {
|
||||
demo,
|
||||
|
|
Loading…
Reference in New Issue