0.1.4 • Published 4 years ago

zxy-hello-world-test v0.1.4

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

step1

添加入口文件index.js

import helloworld from "@/components/helloworld";

const HelloWorldSimple = {
  install(Vue, options) {
    // Let's register our component globally
    // https://vuejs.org/v2/guide/components-registration.html
    Vue.component("hello-world", helloworld);
  },
};

// Automatic installation if Vue has been added to the global scope.
if (typeof window !== "undefined" && window.Vue) {
  window.Vue.use(HelloWorldSimple);
}

export default HelloWorldSimple;

Vue.use

Step2

配置package.json

  1. 配置打包命令 vue-cli-service build --target lib --name myLib [entry] vue-cli-service
  2. main
  3. version
  4. files

Step3

上传npm库

  1. npm login
  2. npm publish

Step4

  1. 发现css没有内联,怎么办。
module.exports = {
  css: { extract: false },
};

Step5

调试

yarn link

yarn link [package]

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago