开发UI框架并部署到NPM服务器

  1. 新建空白文件夹
  2. 存放创建vue插件的文件
  3. 打开终端至文件夹路径执行npm init初始化package.json
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (myui)
version: (1.0.0) 0.0.3
description: Q的UI框架
entry point: (Demo.js) index.js
test command:
git repository:
keywords: demo 学习
author: Q
license: (ISC)
About to write to E:\WEB\Vue3\myui\package.json:

{
  "name": "blairq_ui",
  "version": "0.1.0",
  "description": "Q的UI框架",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [
    "npm",
    "UI"
  ],
  "license": "ISC"
}
  1. 注册npm账号 (需翻墙)
  2. 执行npm login输入第4步创建的账密以及邮箱
  3. 执行npm publish发布
  4. 更改内容后需要重新发布时需要更新版本号

关于UI名称: @符号是私有的,不能有/等特殊字符

  1. 安装 npm install blairq_ui@0.0.6 --save 这里使用@版本号指定版本
  2. main.js中引入即可
import myui from 'blairq_ui'

createApp(App).use(store).use(router).use(myui).use(demo, {a: 'aaa'}).mount('#app')

  1. 在组件中直接使用即可
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值