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

修复初始值绑定有些情况不生效的 bug #11

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
24 changes: 13 additions & 11 deletions components/mpvue-picker/mpvuePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
pickerValueMulTwoTwo: [],
pickerValueMulThreeOne: [],
pickerValueMulThreeTwo: [],
pickerValueMulThreeThree: [],
/* 是否显示控件 */
pickerValueMulThreeThree: [],
/* 是否显示控件 */
showPicker: false,
};
},
Expand All @@ -92,15 +92,15 @@
/* picker 数值 */
pickerValueArray: {
type: Array,
default(){
return []
default(){
return []
}
},
/* 默认值 */
pickerValueDefault: {
type: Array,
default(){
return []
default(){
return []
}
},
/* 几级联动 */
Expand All @@ -117,15 +117,17 @@
},
mode(oldVal, newVal) {
this.modeChange = true;
},
pickerValueArray(val){
this.initPicker(val);
},
pickerValueArray(val){
this.initPicker(val);
}
},
methods: {
initPicker(valueArray) {
let pickerValueArray = valueArray;
this.pickerValue = this.pickerValueDefault;
setTimeout(() => {
this.pickerValue = this.pickerValueDefault;
});
// 初始化多级联动
if (this.mode === 'selector') {
this.pickerValueSingleArray = valueArray;
Expand Down Expand Up @@ -460,4 +462,4 @@
height: 238px;
background-color: rgba(255, 255, 255, 1);
}
</style>
</style>