Skip to content
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

奇怪的动态加载时候的model重复加载 #480

Closed
ityao opened this issue Jan 9, 2017 · 2 comments
Closed

奇怪的动态加载时候的model重复加载 #480

ityao opened this issue Jan 9, 2017 · 2 comments

Comments

@ityao
Copy link

ityao commented Jan 9, 2017

{ path: 'profile/phone', getComponent(nextState, cb) { require.ensure([], (require) => { if(!checkModel['profile/phone']){ let result = app.model(require('../models/phone')); //手机绑定 checkModel['profile/phone'] = true //防止重复加载 } cb(null, require('./profile/PhonePage')) }) } }

在require.ensure([], (require) => { 里面去做app.model的时候第一次进入没错, 后面进入就报重复加载model, 有没有一个model有否重复加载的机制去防止, 现在我自己实现checkModel对象去保存加载情况, 有点啰嗦

@ityao
Copy link
Author

ityao commented Jan 10, 2017

#460

@sorrycc
Copy link
Member

sorrycc commented Jan 22, 2017

对动态加载的问题总结了下,有问题在 #533 里跟进。

@sorrycc sorrycc closed this as completed Jan 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants