import Button from './components/button/src/main' import Dialog from './components/dialog/src/main' import Header from './components/header/src/main' const components = [Button,Dialog,Header] const install = function(Vue){ if(install.installed) return components.map(component=>{ Vue.component(component.name,component) }) if(typeof window !== 'undefined'&&window.Vue){ console.log("传入参数install方法") install(window.Vue) } } console.log("Button") console.log(Button) export default{ install }