About the global components of Vue

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.

clipboard.png

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)

what result do you expect? What is the error message actually seen?

May.22,2021

defines that the plug-in exposes a install > method method
when used Vue.use (MyPlugin) the plug-in's install method
ide/plugins.html" rel=" nofollow noreferrer "> Vue.use plug-in

is called internally.
Menu