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