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: 修复u-picker在mode为multiSelector模式下columnchange监听列变化bug #1248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion uview-ui/components/u-picker/u-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -544,11 +544,12 @@ export default {
} else if (this.mode == 'multiSelector') {
let index = null;
// 对比前后两个数组,寻找变更的是哪一列,如果某一个元素不同,即可判定该列发生了变化
this.defaultSelector.map((val, idx) => {
this.multiSelectorValue.map((val, idx) => {
if (val != e.detail.value[idx]) index = idx;
});
// 为了让用户对多列变化时,对动态设置其他列的变更
if (index != null) {
this.multiSelectorValue = e.detail.value
this.$emit('columnchange', {
column: index,
index: e.detail.value[index]
Expand Down