Vue project iview reports an error after being packaged with view components

I used the iview plug-in in the vue project. There is no problem with iview components such as page,select, but the view components using Modal,Message will report errors. How should I solve this problem?

this is because the view component in this.$Message.warning () does not define the reported error

clipboard.png

import "babel-polyfill"
import "./assets/css/reset.styl"
import "./assets/css/theme-default.styl"
import Vue from "vue"
import Vuex from "vuex"
import App from "./App"
import {
  i18n
} from "@/locale"
import store from "@/store"
import router from "./router"
import axios from "@/apis/http/axios.js"
import commonHttp from "@/apis/http/commonHttp"
import _P from "@/assets/js/public"
import HappyScroll from "vue-happy-scroll"
import iView from "iview";
import "iview/dist/styles/iview.css";
import {Message,Spin,Page,Switch,Upload,Select,Slider,CheckboxGroup,Modal,Checkbox} from "iview";

import "vue-happy-scroll/docs/happy-scroll.css";

Vue.config.productionTip = false
Vue.use(Vuex)
Vue.use(_P)
Vue.use(HappyScroll)
Vue.use(iView)
Vue.prototype.axios = axios
Vue.prototype.commonHttp = commonHttp
Vue.prototype.$Message = Message
Vue.prototype.$Spin = Spin
Vue.prototype.$Page = Page
Vue.prototype.$Switch = Switch
Vue.prototype.$Upload = Upload
Vue.prototype.$Select = Select
Vue.prototype.$Slider = Slider
Vue.prototype.$CheckboxGroup = CheckboxGroup
Vue.prototype.$Modal = Modal
Vue.prototype.$Checkbox = Checkbox


/* eslint-disable no-new */
new Vue({
  el: "-sharpapp",
  router,
  i18n,
  store,
  template: "<App/>",
  components: {
    App
  }
})

The message component of

iview is a little special. Export comes out with built-in functions, which need to be called by function

.
Vue.use(iView)
-------------------------------
Vue.use(iView, {
  transfer: true,
  size: 'large'
});
-------------------------------
Vue.prototype.$Message = Message
Vue.prototype.$Spin = Spin
Vue.prototype.$Page = Page
Vue.prototype.$Switch = Switch
Vue.prototype.$Upload = Upload
Vue.prototype.$Select = Select
Vue.prototype.$Slider = Slider
Vue.prototype.$CheckboxGroup = CheckboxGroup
Vue.prototype.$Modal = Modal
Vue.prototype.$Checkbox = Checkbox

Why did you introduce it in three different ways?


you can post the reported error before you know how to solve it.

Menu