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

不会出现循环引用吗? #3

Open
Shu-Ji opened this issue Feb 24, 2017 · 3 comments
Open

不会出现循环引用吗? #3

Shu-Ji opened this issue Feb 24, 2017 · 3 comments

Comments

@Shu-Ji
Copy link

Shu-Ji commented Feb 24, 2017

入口main.js中import了http,而http中import了router,router中import了repository,repository中import了http

@superman66
Copy link
Owner

我觉得这不会循环引用。
router引入repository只是为了定义路由的component

@Shu-Ji
Copy link
Author

Shu-Ji commented Feb 24, 2017

你可以console.log看看了,respository里面import的地方在启动时就会执行了。所以import {fetch} from './http'这里是会去import http的,而http又import router了

@superman66
Copy link
Owner

superman66 commented Feb 24, 2017

这是我console.log出来的结果:

1487945146058: repository....
1487945146065: router....
1487945146071: http....
1487945146149: main.js....
[WDS] Hot Module Replacement enabled.

我有点不明白你说的循环引用怎么看出来。还望指教~

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