Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复数据域改变,nav没有动态修改的问题 #9829

Merged
merged 3 commits into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/amis/src/renderers/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,9 @@ const ConditionBuilderWithRemoteOptions = withRemoteConfig({
if (!!link.disabled) {
return false;
}
return motivation !== 'location-change' &&

return motivation &&
!['location-change', 'data-change'].includes(motivation) &&
typeof link.active !== 'undefined'
? link.active
: (depth === level
Expand Down Expand Up @@ -1214,6 +1216,8 @@ const ConditionBuilderWithRemoteOptions = withRemoteConfig({
this.props.updateConfig(this.props.config, 'location-change');
} else if (!isEqual(this.props.links, prevProps.links)) {
this.props.updateConfig(this.props.links, 'update');
} else if (!isEqual(this.props.data, prevProps.data)) {
this.props.updateConfig(this.props.config, 'data-change');
}

// 外部修改defaultOpenLevel 会影响菜单的unfolded属性
Expand Down