import VueClipboard from 'vue-clipboard2'
 
import MessagePlugin from '../message'
import * as filters from './filters'
import numberOnly from './directives/numberOnly'
 
import mixins from './mixins'
import powerMixin from './mixins/powerMixin.js'

import '@/components'

let BasicPlugin = {}

BasicPlugin.install = function (Vue, options) {
  Vue.config.productionTip = false
  Vue.use(ToastPlugin, { position: 'middle' })
  Vue.use(BusPlugin)
  Vue.use(ConfirmPlugin)
  Vue.use(AlertPlugin)
  Vue.use(VueClipboard)
  Vue.use(VueAppend)
  Vue.use(MessagePlugin)
  Vue.mixin(mixins)
  Vue.mixin(powerMixin)
  Vue.prototype.$checkLogin = function () {
    const token = util.cookies.get('token')
    return !token || token === 'undefined' ? 0 : 1
  }
  Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
  })

  Vue.directive('number-only', numberOnly)
  Vue.directive('listen-keybord', listenKeybord)
}

export default BasicPlugin

  

https://www.cnblogs.com/mengfangui/p/9046525.html