feat: add VirtualScroll tree
parent
18295ea0d7
commit
9785531e54
|
@ -199,6 +199,7 @@ export default defineComponent({
|
|||
selectable,
|
||||
fieldNames = props.replaceFields,
|
||||
motion = props.openAnimation,
|
||||
itemHeight = 20,
|
||||
} = props;
|
||||
const newProps = {
|
||||
...attrs,
|
||||
|
@ -207,13 +208,13 @@ export default defineComponent({
|
|||
dropIndicatorRender,
|
||||
fieldNames,
|
||||
icon,
|
||||
itemHeight,
|
||||
};
|
||||
|
||||
return (
|
||||
<VcTree
|
||||
itemHeight={20}
|
||||
virtual={virtual.value}
|
||||
{...newProps}
|
||||
virtual={virtual.value}
|
||||
motion={motion}
|
||||
ref={treeRef}
|
||||
prefixCls={prefixCls.value}
|
||||
|
|
|
@ -561,9 +561,10 @@ export default defineComponent({
|
|||
}
|
||||
|
||||
// [Legacy] Not found related usage in doc or upper libs
|
||||
const keyEntitiesValue = keyEntities.value;
|
||||
const selectedNodes = newSelectedKeys
|
||||
.map(selectedKey => {
|
||||
const entity = keyEntities.value[selectedKey];
|
||||
const entity = keyEntitiesValue[selectedKey];
|
||||
if (!entity) return null;
|
||||
|
||||
return entity.node;
|
||||
|
@ -605,8 +606,9 @@ export default defineComponent({
|
|||
const newHalfCheckedKeys = arrDel(halfCheckedKeys.value, key);
|
||||
checkedObj = { checked: newCheckedKeys, halfChecked: newHalfCheckedKeys };
|
||||
|
||||
const keyEntitiesValue = keyEntities.value;
|
||||
eventObj.checkedNodes = newCheckedKeys
|
||||
.map(checkedKey => keyEntities.value[checkedKey])
|
||||
.map(checkedKey => keyEntitiesValue[checkedKey])
|
||||
.filter(entity => entity)
|
||||
.map(entity => entity.node);
|
||||
|
||||
|
@ -829,14 +831,6 @@ export default defineComponent({
|
|||
}
|
||||
};
|
||||
|
||||
// const getActiveItem = () => {
|
||||
// if (activeKey.value === null) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// return flattenNodes.value.find(({ data: { key } }) => key === activeKey.value) || null;
|
||||
// };
|
||||
|
||||
const activeItem = computed<FlattenNode>(() => {
|
||||
if (activeKey.value === null) {
|
||||
return null;
|
||||
|
|
|
@ -36,7 +36,7 @@ export default function useHeights<T>(
|
|||
const origin = instance.get(key);
|
||||
|
||||
if (ins) {
|
||||
instance.set(key, ins);
|
||||
instance.set(key, (ins as any).$el || ins);
|
||||
collectHeight();
|
||||
} else {
|
||||
instance.delete(key);
|
||||
|
|
2
v2-doc
2
v2-doc
|
@ -1 +1 @@
|
|||
Subproject commit bf82708b6f320f1e9b185c6eba58b4ce08593fc3
|
||||
Subproject commit e7db31900631a7da14f40b7f2ab0e3f266a26e00
|
Loading…
Reference in New Issue