fix(dropdown-menu): 修复DropdownItem组件不受控 #1145
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔 这个 PR 的性质是?
🔗 相关 Issue
fix #1139
💡 需求背景和解决方案
dropdown-item
不受控,排查发现问题出在dropdown-menu
组件,没有及时更新,是因为在监听变化后返回了自身的label
不清楚为什么要使用自身的
label
,在上方已经有获取到的目标,就修改了取menuTitles
改为了target
,修复了动态修改没更新的问题。另外一个问题是展开和收缩之后,又自动修改回原来的
label
了,排查发现在展开时,没有重新赋值给state
,于是添加了📝 更新日志
fix(DropdownMenu): 解决
DropdownItem
组件的label
属性不受控本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单