Skip to content

Commit

Permalink
feat: Picker适配微信
Browse files Browse the repository at this point in the history
  • Loading branch information
rayhomie committed May 22, 2024
1 parent 5261a72 commit 435a6c5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion compiled/alipay/src/Picker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Component(
this.single
);
const formatValueByProps = onFormat && onFormat(realValue, matchedColumn);
if (typeof formatValueByProps !== 'undefined') {
if (formatValueByProps !== undefined && formatValueByProps !== null) {
return formatValueByProps;
}
return this.defaultFormat(realValue, matchedColumn);
Expand Down
10 changes: 6 additions & 4 deletions compiled/wechat/src/Picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Component(PickerDefaultProps, {
var realValue = this.getValue();
var matchedColumn = getStrictMatchedItemByValue(columns, realValue, this.single).matchedColumn;
var formatValueByProps = onFormat && onFormat(realValue, matchedColumn);
if (typeof formatValueByProps !== 'undefined') {
if (formatValueByProps !== undefined && formatValueByProps !== null) {
return formatValueByProps;
}
return this.defaultFormat(realValue, matchedColumn);
Expand Down Expand Up @@ -243,9 +243,11 @@ Component(PickerDefaultProps, {
},
'visible': function () {
var visible = getValueFromProps(this, 'visible');
this.setData({
visible: visible,
});
if (this.data.visible !== visible) {
this.setData({
visible: visible,
});
}
},
'formattedValueText': function () {
var formattedValueText = getValueFromProps(this, 'formattedValueText');
Expand Down
10 changes: 6 additions & 4 deletions src/Picker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Component(
this.single
);
const formatValueByProps = onFormat && onFormat(realValue, matchedColumn);
if (typeof formatValueByProps !== 'undefined') {
if (formatValueByProps !== undefined && formatValueByProps !== null) {
return formatValueByProps;
}
return this.defaultFormat(realValue, matchedColumn);
Expand Down Expand Up @@ -295,9 +295,11 @@ Component(
},
'visible': function () {
const visible = getValueFromProps(this, 'visible');
this.setData({
visible,
});
if (this.data.visible !== visible) {
this.setData({
visible,
});
}
},
'formattedValueText': function () {
const formattedValueText = getValueFromProps(
Expand Down

0 comments on commit 435a6c5

Please sign in to comment.