提交 fd57b83d 作者: 无木

fix(basicTree): checked with searching, fixed #2070

上级 513ccb95
...@@ -90,10 +90,10 @@ ...@@ -90,10 +90,10 @@
onCheck: (v: CheckKeys, e) => { onCheck: (v: CheckKeys, e) => {
let currentValue = toRaw(state.checkedKeys) as KeyType[]; let currentValue = toRaw(state.checkedKeys) as KeyType[];
if (isArray(currentValue) && searchState.startSearch) { if (isArray(currentValue) && searchState.startSearch) {
const { key } = unref(getFieldNames); const value = e.node.eventKey;
currentValue = difference(currentValue, getChildrenKeys(e.node.$attrs.node[key])); currentValue = difference(currentValue, getChildrenKeys(value));
if (e.checked) { if (e.checked) {
currentValue.push(e.node.$attrs.node[key]); currentValue.push(value);
} }
state.checkedKeys = currentValue; state.checkedKeys = currentValue;
} else { } else {
...@@ -437,7 +437,11 @@ ...@@ -437,7 +437,11 @@
{extendSlots(slots)} {extendSlots(slots)}
</TreeHeader> </TreeHeader>
)} )}
<Spin wrapperClassName={unref(props.treeWrapperClassName)} spinning={unref(props.loading)} tip="加载中..."> <Spin
wrapperClassName={unref(props.treeWrapperClassName)}
spinning={unref(props.loading)}
tip="加载中..."
>
<ScrollContainer style={scrollStyle} v-show={!unref(getNotFound)}> <ScrollContainer style={scrollStyle} v-show={!unref(getNotFound)}>
<Tree {...unref(getBindValues)} showIcon={false} treeData={treeData.value} /> <Tree {...unref(getBindValues)} showIcon={false} treeData={treeData.value} />
</ScrollContainer> </ScrollContainer>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论