解决微信小程序首页空白问题。
This commit is contained in:
@@ -155,7 +155,12 @@
|
||||
})
|
||||
// #endif
|
||||
|
||||
this.searchText = getApp().globalData.searchText;
|
||||
try {
|
||||
const app = getApp({ allowDefault: true });
|
||||
this.searchText = app && app.globalData ? app.globalData.searchText : '';
|
||||
} catch (e) {
|
||||
this.searchText = '';
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
associativeShow() {
|
||||
@@ -298,7 +303,14 @@
|
||||
this.loadList(item.title);
|
||||
},
|
||||
loadList(text = '') {
|
||||
getApp().globalData.searchText = text;
|
||||
try {
|
||||
const app = getApp({ allowDefault: true });
|
||||
if (app && app.globalData) {
|
||||
app.globalData.searchText = text;
|
||||
}
|
||||
} catch (e) {
|
||||
// 静默失败
|
||||
}
|
||||
uni.switchTab({
|
||||
url:'/pages/list/list'
|
||||
})
|
||||
@@ -318,7 +330,14 @@
|
||||
})
|
||||
} else {
|
||||
this.associativeList.length = 0;
|
||||
getApp().globalData.searchText = '';
|
||||
try {
|
||||
const app = getApp({ allowDefault: true });
|
||||
if (app && app.globalData) {
|
||||
app.globalData.searchText = '';
|
||||
}
|
||||
} catch (e) {
|
||||
// 静默失败
|
||||
}
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user