Skip to content
本页目录

开发说明

组件开发

  • 目录:package
  • 示例:package/demo

注册组件

package/index.ts 中注册

ts
let componentList = [MyComponent, TestComponent] // 组件引入

componentList.forEach(comp => {
  const c = comp as any
  c.install = function (app: App) {
    app.component(c.name, comp)
  }
})

export { MyComponent, TestComponent } // 组件导出
let componentList = [MyComponent, TestComponent] // 组件引入

componentList.forEach(comp => {
  const c = comp as any
  c.install = function (app: App) {
    app.component(c.name, comp)
  }
})

export { MyComponent, TestComponent } // 组件导出

打包及上传

  1. 上传前需要打包更新库文件(lib/index.js)
  2. 修改 package.json 中版本号
  3. 运行打包命令
bash
pnpm run build
pnpm run build
  1. 上传 git
  2. 通知其他项目更新组件

预算单位软件产品开发部