is the cause of asynchrony. Hang isBgWindow on the parent component tag, such as
//
<group-component isBgWindow="{{isBgWindow}}"></group-components>
//
Component({
/**
*
*/
properties: {
isBgWindow: {
type: Boolean,
value: 0,
observer: function (newVal, oldVal, changedPath) {
}
},
},
ready: function() {
let isBgWindow = this.data.isBgWindow;
console.log(isBgWindow);
},
})
here's how I handle it: the wx.login method app.js can be called by the parent component, and there is a callback to the parent component, which is passed to the child component
found something called userInfoReadyCallback, that you can use to call the data returned by app.js on other pages
1. The component must be applied in Page before you can decide to render. Declare in the page .json file that your component uses useComonents to register your component on the page, otherwise it will not render.
2. And Mini Program does not trigger redrawing in the same way as Vue, but may be a bit like react using this.setData to change data.