在未使用自定义组件时,可以正常显示,现在加入了一个自定义组件,报下面的错误
WAService.js:12 Uncaught (in promise) TypeError: Cannot read property ‘__route__’ of undefined
at WAService.js:12
at EmitterService.js? [sm]:47
at Array.forEach (<anonymous>)
at EmitterService.emit (EmitterService.js? [sm]:46)
at Object.publishWorkContext (WorkContextService.js? [sm]:49)
at Object.<anonymous> (CheckoutService.js? [sm]:65)
at r (tslib.js? [sm]:1)
at Object.next (tslib.js? [sm]:1)
at _ (tslib.js? [sm]:1)
at <anonymous>
(anonymous) @ WAService.js:12
(anonymous) @ EmitterService.js? [sm]:47
EmitterService.emit @ EmitterService.js? [sm]:46
publishWorkContext @ WorkContextService.js? [sm]:49
(anonymous) @ CheckoutService.js? [sm]:65
r @ tslib.js? [sm]:1
(anonymous) @ tslib.js? [sm]:1
_ @ tslib.js? [sm]:1
Promise rejected (async)
i @ tslib.js? [sm]:1
(anonymous) @ tslib.js? [sm]:1
__awaiter @ tslib.js? [sm]:1
BillingAddressPage.onSelectAddress @ billingAddressPage.js? [sm]:88
(anonymous) @ WAService.js:13
a @ WAService.js:13
K @ WAService.js:13
(anonymous) @ WAService.js:13
(anonymous) @ WAService.js:13
(anonymous) @ WAService.js:6
e.(anonymous function) @ WAService.js:3
d @ appservice:1728
g.registerCallback @ appservice:1728
k.forEach @ appservice:1728
d @ appservice:1728
h.onmessage @ appservice:1728
如何使用wx.navigateTo报错,用wx.redirectTo不报错
Component({
properties: {
model: {
type: Object,
value: {}
},
},
data: {},
methods: {
onChooseBillingAddress(e) {
let url = PageConfig.checkoutBillingAddressPage.url;
// PageUtil.navigateTo(url);
// 报错
wx.navigateTo({
url
});
// 不报错
wx.redirectTo({
url
});
}
}
});