2.1.4 • Published 16 days ago

aviana-plugin-vue v2.1.4

Weekly downloads
2
License
MIT
Repository
-
Last release
16 days ago

Aviana 前端微应用插件(Vue 版本)

插件说明

  1. 插件使用:
import { install, buildRoutes, start } from "aviana-plugin-vue";
install({
  ...config,
  createRouter: (root) => {
    return new Router({
      routes: buildRoutes(routes, root),
    });
  },
  createInstance: (router) => {
    return new Vue({
      router: router,
      store: store,
      render: (h) => h(App),
    });
  },
});

export { bootstrap, mount, unmount } from "aviana-plugin-vue";
start();
  1. 插件提供:
1. 封装微应用的注册逻辑
2. 全局的 $http 对象,通过config中的httpConfig, mock注册接口及mock数据
    提供设置独立运行时Token及网络状态获取方法 { setToken, getHttpInfo, getIsolatedInfo }
    提供网络调用方法 { get, getBy, post, update, remove, removeBy }
3. 全局的 $iac 对象,提供发布消息,监听消息,获取全局数据等方法
    提供应用间通信方法 { name, obtainApp, open, set, get, getOwn, emit, on, once, release, call, callOwn }
4. 全局混入响应式的 userInfo, companyInfo, token
5. 可在 mock 中配置 userInfo, companyInfo, 用于单应用开发调试
6. 全局的 log 方法,可在 template 中直接打印变量值进行调试

发布 NPM 包到 Github Packages

  1. 在 Github 申请一个 TOKEN, 用来发布和获取 npm 包
  2. 在本项目的根目录添加 .npmrc 文件,并添加如下配置 registry=https://npm.pkg.github.com //npm.pkg.github.com/:_authToken=TOKEN
  3. 在 package.json 中更新版本号, npm run build:lib 打包库文件
  4. npm publish 发布包到 Github

其他工程获取 NPM 包

  1. 在 package.json 添加依赖 "@ucloudcastle/aviana-plugin-vue": "^x.x.x"
  2. 拷贝本项目下的 .npmrc 文件
  3. npm install

发布 NPM 包到 npmjs

  1. https://www.npmjs.com/ 注册账户并申请 Token, 用来发布和获取 npm 包
  2. 在本项目的根目录添加 .npmrc 文件,并添加如下配置 registry=http://registry.npmjs.org //registry.npmjs.org/:_authToken=TOKEN
  3. 在 package.json 中更新版本号, npm run build:lib 打包库文件
  4. npm publish 发布包到 npmjs

其他工程获取 NPM 包

  1. 在 package.json 添加依赖 "aviana-plugin-vue": "^x.x.x"
  2. npm install

代码打包说明 npm run build builds the library to dist, generating three files:

  • dist/aviana-plugin-vue.cjs.js A CommonJS bundle, suitable for use in Node.js, that requires the external dependency. This corresponds to the "main" field in package.json
  • dist/dist/aviana-plugin-vue.esm.js an ES module bundle, suitable for use in other people's libraries and applications, that imports the external dependency. This corresponds to the "module" field in package.json
  • dist/dist/aviana-plugin-vue.umd.js a UMD build, suitable for use in any environment (including the browser, as a <script> tag), that includes the external dependency. This corresponds to the "browser" field in package.json

npm run dev builds the library, then keeps rebuilding it whenever the source files change using rollup-watch.

npm test builds the library, then tests it.

2.1.4

16 days ago

2.1.3

2 months ago

2.1.2

2 months ago

2.1.1

2 months ago

2.1.0

2 months ago

2.0.9

4 months ago

2.0.8

4 months ago

2.0.7

4 months ago

2.0.6

4 months ago

1.2.3

8 months ago

2.0.3

6 months ago

2.0.2

8 months ago

2.0.5

6 months ago

2.0.4

6 months ago

2.0.1

8 months ago

2.0.0

8 months ago

1.2.2

10 months ago

1.2.1

10 months ago

1.2.0

10 months ago

1.1.10

10 months ago

1.1.9

11 months ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.6.17

2 years ago

0.6.16

2 years ago

0.6.15

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.0

2 years ago

0.7.9

2 years ago

0.7.6

2 years ago

0.7.5

2 years ago

0.7.8

2 years ago

0.7.7

2 years ago

0.6.7

2 years ago

0.6.6

2 years ago

0.6.9

2 years ago

0.6.8

2 years ago

0.6.10

2 years ago

0.6.12

2 years ago

0.6.11

2 years ago

0.6.14

2 years ago

0.6.13

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.7

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.13

3 years ago

0.4.10

3 years ago

0.4.11

3 years ago

0.4.12

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.5

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.15

3 years ago

0.3.14

3 years ago

0.3.13

3 years ago

0.3.12

3 years ago

0.3.11

3 years ago

0.3.10

3 years ago

0.3.9

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4

3 years ago

0.3.2

3 years ago

0.3.3

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.8

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

4 years ago

0.1.3

4 years ago