亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

詳解如何創(chuàng)建并發(fā)布一個(gè) vue 組件

 更新時(shí)間:2018年11月08日 10:44:04   作者:wangfulin  
這篇文章主要介紹了詳解如何創(chuàng)建并發(fā)布一個(gè)vue組件,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧

步驟

創(chuàng)建 vue 的腳手架

npm install -g @vue/cli
vue init webpack

綁定 git 項(xiàng)目

cd existing_folder
git init
git remote add origin http://gitlab.alipay-inc.com/ampg/my-projec.git
git add .
git commit
git push -u origin master

寫組件

創(chuàng)建組件 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>

發(fā)布

npm publish

展示

代碼參考
vue-component-popup

參考文檔
Packaging Vue Components for npm
Vue CLI 3
vue-sfc-rollup

以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論