javascript - Vue js is it ok to register all components globally? - Stack Overflow

Is it okgood practice to register all ponents globally?Reasonto avoid doing of imports of ponents manu

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 badges
Add a ment  | 

1 Answer 1

Reset to default 9

You 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信