-
Notifications
You must be signed in to change notification settings - Fork 479
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
新手问题 #131
Comments
1、请求应该放在store中还是model中进行? 我倾向于放到 store 中,model 只管数据注入,不管数据请求 2、假如在页面的onLoad中,我需要根据store的数据进行一些判断(store里的数据是需要请求获取到的),然而用this.data.xxx获取不到, a. getMetadata 是异步所以取不到啊 async onLoad() {
metadataStore.bind(this);
await metadataStore.getMetadata();
// 这里获取不到webSitch
if (this.data.webSwitch.near_jobs_status) {
// do something
}
} b.你不用到把逻辑写到 onLoad 里 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1、请求应该放在store中还是model中进行?
2、假如在页面的onLoad中,我需要根据store的数据进行一些判断(store里的数据是需要请求获取到的),然而用this.data.xxx获取不到,代码如下:
model
store
view
The text was updated successfully, but these errors were encountered: