const files = require.context('.', false, /\.vue$/)

function plugin (Vue) {
  if (plugin.installed) {
    return
  }
  files.keys().forEach(key => {
    let name = key.replace(/(\.\/|\.vue)/g, '')
    Vue.component(name, files(key).default)
  })
}

export default plugin
