https://anciity.github.io/post/vue-ru-he-kai-fa-yi-ge-ming-ling-shi-dan-chuang-zu-jian/

import Vue from "vue";
import AlertM from "./Alert.vue";

let MessageConstructor = Vue.extend(AlertM);

let init = options => {
    let instance = new MessageConstructor();
    Object.assign(instance, options);
    document.body.appendChild(instance.$mount().$el);
    return instance;
};
let caller = options => {
    let instance = init(options);
    instance.show = true;
};
export default function(vue) {
    vue.prototype.$AlertM = caller;
}