main.vue is the component body, and when I import this file directly in main.js and set the Vue.component in main.js, the global component definition is successful and can be used anywhere.
when I set up Vue.component, in plugin-alert-index.js and then introduce index.js in main.js does not work, what is the cause?
//index.js
import Vue from "vue"
import Alert from "./src/main";
/* istanbul ignore next */
Alert.install = function(Vue) {
Vue.component(Alert.name, Alert);
};
export default Alert;
//main.js
import alert from "../plugin/alert/index.js"
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)