import Vue from 'vue'; import App from './App.vue'; import router from './router'; import { Modal, DatePicker, Table, message } from 'ant-design-vue'; import 'ant-design-vue/dist/antd.css'; Vue.use(Modal) Vue.use(DatePicker) Vue.use(Table) Vue.prototype.$message = message;
类似于this.$message这种方法的调用,需要Vue的原型上添加对象方法