Now I am faced with two options for injecting my component into my application.
- The first method is in app.js
Vue.component(
"notice-master-component",
require("./components/site/communication/Notice/MasterComponent.vue")
);
- In any Vue component where the component is needed
import NoticeMasterComponent from "../Notice/MasterComponent.vue";
export default {
components: {
NoticeMasterComponent ,
In both scenarios, the component can be used.
Which approach is considered better or recommended?