Is it ok/good practice to register all ponents globally?
Reason
- to avoid doing of imports of ponents manually when other ponents needed them.
- a bit annoyed seeing ponent with lots of import when the app gets bigger.
Are there any downside of this?
Is it ok/good practice to register all ponents globally?
Reason
- to avoid doing of imports of ponents manually when other ponents needed them.
- a bit annoyed seeing ponent with lots of import when the app gets bigger.
Are there any downside of this?
Share Improve this question asked May 29, 2019 at 3:48 PenAndPapersPenAndPapers 2,1089 gold badges34 silver badges65 bronze badges1 Answer
Reset to default 9You generally shouldn't register a ponent globally if you aren't going to use it frequently throughout your application. Quoting the docs ...
Global registration often isn’t ideal. For example, if you’re using a build system like Webpack, globally registering all ponents means that even if you stop using a ponent, it could still be included in your final build. This unnecessarily increases the amount of JavaScript your users have to download.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745380811a4625216.html
评论列表(0条)