步骤创建 vue 的脚手架npm install -g @vue/clivue init webpack绑定 git 项目cd existing_foldergit initgit remote add origin http://gitlab.alipay-inc.com/ampg/my-projec.gitgit add .git commitgit push -u origin master写组件创建组件 src/components/xxx.vue例如:<template> <div class=“hello”> <h1>{{ msg }}</h1> <h2>Essential Links</h2> </div></template><script>export default { name: ‘HelloWorld’, data () { return { msg: ‘Welcome to Your Vue.js App’ } }}</script><!– Add “scoped” attribute to limit CSS to this component only –><style scoped>h1, h2 { font-weight: normal;}</style>发布npm publish展示代码参考vue-component-popup参考文档Packaging Vue Components for npmVue CLI 3vue-sfc-rollup