When developing a Vue application, you need to check for some basic rules that can help the development and won't open any doors for the external manipulation of your application.
Here are some tips for using Vue:
- Always add type validation to your props, and if possible, a validator check.
- Avoid the global registration of components; use local components.
- Always use lazy-loaded components, when possible.
- Use $refs instead of direct DOM manipulation.
Here are some tips on what not to do when using Vue:
- Never store Vue, $vm, $store, or any application variable on the window or any global scope.
- Never modify the Vue prototype; if you need to add a new variable to the prototype, make a new Vue plugin.
- It's not recommended to use a direct connection between components, as it will make the component bound to the parent or child.