-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Lazy loaded Component shouldn't be prefixed with Lazy #83
Comments
yeah, I also felt it was a weird design choice. |
Agree. An attribute/directive would fit in better not just with Vue's API but html itself. Like how you have attributes like |
Agree! |
Supporting attribute requires having a loader that is not always working (global components and development mode). Still, you have a better prefix suggestion, which is more than welcome. We can easily add as an alias to plugin |
Ok, if no directive, is it weird to do something like: MyComponentName.lazy.vue <my-component-name.lazy> But the directive approach was better for sure as it allowed you to opt into lazy loading for that use of the component, rather than always lazy loading it always. |
Nice idea @drewbaker! I've created #180 to check different options we could have for naming |
Dynamically (lazy loaded) components shouldn't be prefixed with Lazy. It adds confusion and can become dirty pretty quickly (especially I have a bunch of custom components in an other project with names already beginning with Lazy, like LazyLoad, LazySpin etc.)
So, instead of this:
you should use an explicit attribute (like defer, or lazy, IDN), maybe like this:
The text was updated successfully, but these errors were encountered: