{"versions":{"1.0.3":{"name":"@hussarjs/pluggable","version":"1.0.3","description":"轻骑兵可插拔插件系统支持库","main":"dist/index.js","module":"dist/pluggable.esm.js","typings":"dist/index.d.ts","files":["dist","build","package.json"],"keywords":["vue","vue-plugins","vue-pluggable","plugin","plugin-ecosystem","vue-ecosystem"],"scripts":{"start":"tsdx watch","build":"tsdx build","lint":"tsdx lint","prepare":"tsdx build"},"author":{"name":"轻骑兵前端架构团队"},"license":"ISC","peerDependencies":{"vue":">= 2.7.14"},"dependencies":{},"devDependencies":{"vue":"^2.7.14","@types/semver":"^7.3.2","@typescript-eslint/eslint-plugin":"^5.59.1","@vue/compiler-sfc":"^2.7.14","vue-template-compiler":"^2.7.14","rollup-plugin-vue":"^5.0.0","semver":"^7.3.2","tsdx":"^0.13.3","tslib":"^2.0.1","typescript":"^4.0.2","vue-demi":"^0.14.10"},"readmeFilename":"README.md","gitHead":"83a1fcc831eb9141c19914abc8ba59f1b82ac889","_id":"@hussarjs/pluggable@1.0.3","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-BOnssjbuKJOXa+KRKi63FV1/8FwnpFHAQasJ2WLVoFkpxX2ToOgK1bzzcB+H3wsOfSKb0SiJwq48krglHN0xPw==","shasum":"8bd10337020a512ee5201135d22b281e30c016fb","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hussarjs/pluggable/-/pluggable-1.0.3.tgz"},"contributors":[]},"1.0.4":{"name":"@hussarjs/pluggable","version":"1.0.4","description":"轻骑兵可插拔插件系统支持库","main":"dist/index.js","module":"dist/pluggable.esm.js","typings":"dist/index.d.ts","files":["dist","build","package.json"],"keywords":["vue","vue-plugins","vue-pluggable","plugin","plugin-ecosystem","vue-ecosystem"],"scripts":{"start":"tsdx watch","build":"tsdx build","lint":"tsdx lint","prepare":"tsdx build"},"author":{"name":"轻骑兵前端架构团队"},"license":"ISC","peerDependencies":{"vue":">= 2.7.14"},"dependencies":{},"devDependencies":{"vue":"^2.7.14","@types/semver":"^7.3.2","@typescript-eslint/eslint-plugin":"^5.59.1","@vue/compiler-sfc":"^2.7.14","vue-template-compiler":"^2.7.14","rollup-plugin-vue":"^5.0.0","semver":"^7.3.2","tsdx":"^0.13.3","tslib":"^2.0.1","typescript":"^4.0.2","vue-demi":"^0.14.10"},"readmeFilename":"README.md","gitHead":"00cc9dfc52f945253e103267c30b69552936f4dc","_id":"@hussarjs/pluggable@1.0.4","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-72kgerPbEcXiZ8vDHGK4Hneb5f1KBTzRhDf6GEluZ4a+Hx5BaLJOgjQ97CwVvVwk1YOD6KhbggJ9VNOgPSfI2A==","shasum":"940def31ad0f8adf4376ca3afbae54e93c659417","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hussarjs/pluggable/-/pluggable-1.0.4.tgz"},"contributors":[]},"1.0.5":{"name":"@hussarjs/pluggable","version":"1.0.5","description":"轻骑兵可插拔插件系统支持库","main":"dist/index.js","module":"dist/pluggable.esm.js","typings":"dist/index.d.ts","files":["dist","build","package.json"],"keywords":["vue","vue-plugins","vue-pluggable","plugin","plugin-ecosystem","vue-ecosystem"],"scripts":{"start":"tsdx watch","build":"tsdx build","lint":"tsdx lint","prepare":"tsdx build"},"author":{"name":"轻骑兵前端架构团队"},"license":"ISC","peerDependencies":{"vue":">= 2.7.14"},"dependencies":{},"devDependencies":{"vue":"^2.7.14","@types/semver":"^7.3.2","@typescript-eslint/eslint-plugin":"^5.59.1","@vue/compiler-sfc":"^2.7.14","vue-template-compiler":"^2.7.14","rollup-plugin-vue":"^5.0.0","semver":"^7.3.2","tsdx":"^0.13.3","tslib":"^2.0.1","typescript":"^4.0.2","vue-demi":"^0.14.10"},"readmeFilename":"README.md","gitHead":"9650fe08710c53b88fb2b0173c53708197e4dbd0","_id":"@hussarjs/pluggable@1.0.5","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-0nHzsvF0X7Wc6It4IEoO2hlHmvWstFwCqNhdq+qETQbVPylJJTAL3cWw6T98l/7rnAt6wSA+Ft+Qm8GS4MdwFw==","shasum":"fc00ce580181a95207470b48357f67f7fb6b136c","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hussarjs/pluggable/-/pluggable-1.0.5.tgz"},"contributors":[]},"1.0.6":{"name":"@hussarjs/pluggable","version":"1.0.6","description":"轻骑兵可插拔插件系统支持库","main":"dist/index.js","module":"dist/pluggable.esm.js","typings":"dist/index.d.ts","files":["dist","build","package.json"],"keywords":["vue","vue-plugins","vue-pluggable","plugin","plugin-ecosystem","vue-ecosystem"],"scripts":{"start":"tsdx watch","build":"tsdx build","lint":"tsdx lint","prepare":"tsdx build"},"author":{"name":"轻骑兵前端架构团队"},"license":"ISC","peerDependencies":{"vue":">= 2.7.14"},"dependencies":{},"devDependencies":{"vue":"^2.7.14","@types/semver":"^7.3.2","@typescript-eslint/eslint-plugin":"^5.59.1","@vue/compiler-sfc":"^2.7.14","vue-template-compiler":"^2.7.14","rollup-plugin-vue":"^5.0.0","semver":"^7.3.2","tsdx":"^0.13.3","tslib":"^2.0.1","typescript":"^4.0.2","vue-demi":"^0.14.10"},"readmeFilename":"README.md","gitHead":"000baee11ed7542f995cf2cf2cedb79e4a14aa20","_id":"@hussarjs/pluggable@1.0.6","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-oHFmWqwhjl7P79tg0iPrG2VtkHQ0swy9b+AGrRt0O8+ipKM99L8hqr2EPS7WoznDk+oTAfMbf7M+BozjeA7lWw==","shasum":"5bb94f571825bfde37a05725a12b35eff0152257","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hussarjs/pluggable/-/pluggable-1.0.6.tgz"},"contributors":[]},"1.0.7":{"name":"@hussarjs/pluggable","version":"1.0.7","description":"轻骑兵可插拔插件系统支持库","main":"dist/index.js","module":"dist/pluggable.esm.js","typings":"dist/index.d.ts","files":["dist","build","package.json"],"keywords":["vue","vue-plugins","vue-pluggable","plugin","plugin-ecosystem","vue-ecosystem"],"scripts":{"start":"tsdx watch","build":"tsdx build","lint":"tsdx lint","prepare":"tsdx build"},"author":{"name":"轻骑兵前端架构团队"},"license":"ISC","peerDependencies":{"vue":">= 2.7.14"},"dependencies":{},"devDependencies":{"vue":"^2.7.14","@types/semver":"^7.3.2","@typescript-eslint/eslint-plugin":"^5.59.1","@vue/compiler-sfc":"^2.7.14","vue-template-compiler":"^2.7.14","rollup-plugin-vue":"^5.0.0","semver":"^7.3.2","tsdx":"^0.13.3","tslib":"^2.0.1","typescript":"^4.0.2","vue-demi":"^0.14.10"},"readmeFilename":"README.md","gitHead":"64b7ae1462ec3e21e9743ba1bddd63150eefbc58","_id":"@hussarjs/pluggable@1.0.7","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-VXA3dJVkh2rCBwsW5lWy0pO4MoRWkdJtHzaG16YuI1q7X4savL5uDQRydFcOjLcNRQ9Fww/uUdLwFJtvHIClAg==","shasum":"1b211c2e60efe7c6d2a31ae3c89177e9e5e9c1e6","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hussarjs/pluggable/-/pluggable-1.0.7.tgz"},"contributors":[]},"1.0.8":{"name":"@hussarjs/pluggable","version":"1.0.8","description":"轻骑兵可插拔插件系统支持库","main":"dist/index.js","module":"dist/pluggable.esm.js","typings":"dist/index.d.ts","files":["dist","build","package.json"],"keywords":["vue","vue-plugins","vue-pluggable","plugin","plugin-ecosystem","vue-ecosystem"],"scripts":{"start":"tsdx watch","build":"tsdx build","lint":"tsdx lint","prepare":"tsdx build"},"author":{"name":"轻骑兵前端架构团队"},"license":"ISC","peerDependencies":{"vue":">= 2.7.14"},"dependencies":{},"devDependencies":{"vue":"^2.7.14","@types/semver":"^7.3.2","@typescript-eslint/eslint-plugin":"^5.59.1","@vue/compiler-sfc":"^2.7.14","vue-template-compiler":"^2.7.14","rollup-plugin-vue":"^5.0.0","semver":"^7.3.2","tsdx":"^0.13.3","tslib":"^2.0.1","typescript":"^4.0.2","vue-demi":"^0.14.10"},"readmeFilename":"README.md","gitHead":"8685f6a6fb61e03e6426a5bdc24b7365c9cd367b","_id":"@hussarjs/pluggable@1.0.8","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-PYtSBQxSL8lk9DWGuy0X3WTTFMU0xWycqFxjBPdeGRzXNFKqut1N2tzoqa2tlqNxmc+mcMk6E+OkRQ/lAz4keg==","shasum":"c29db2bf7e2e0963319e841887eb0e8b5ee89ebb","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hussarjs/pluggable/-/pluggable-1.0.8.tgz"},"contributors":[]},"1.0.9":{"name":"@hussarjs/pluggable","version":"1.0.9","description":"轻骑兵可插拔插件系统支持库","main":"dist/index.js","module":"dist/pluggable.esm.js","typings":"dist/index.d.ts","files":["dist","build","package.json"],"keywords":["vue","vue-plugins","vue-pluggable","plugin","plugin-ecosystem","vue-ecosystem"],"scripts":{"start":"tsdx watch","build":"tsdx build","lint":"tsdx lint","prepare":"tsdx build"},"author":{"name":"轻骑兵前端架构团队"},"license":"ISC","peerDependencies":{"vue":">= 2.7.14"},"dependencies":{},"devDependencies":{"vue":"^2.7.14","@types/semver":"^7.3.2","@typescript-eslint/eslint-plugin":"^5.59.1","@vue/compiler-sfc":"^2.7.14","vue-template-compiler":"^2.7.14","rollup-plugin-vue":"^5.0.0","semver":"^7.3.2","tsdx":"^0.13.3","tslib":"^2.0.1","typescript":"^4.0.2","vue-demi":"^0.14.10"},"readmeFilename":"README.md","gitHead":"dfa26f7f0b339fbf8f85fdcece171761ed31a8c3","_id":"@hussarjs/pluggable@1.0.9","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-bs0A3DQkIUFhTLnKy5Dmez7IVveTjXhplcJp/DtsXiDhD5oVSWe/ZYVyo7PUDLTne4WUMD2LD+QUU2S+R+YtPw==","shasum":"1790521d744b6cba95d599dbf5d98c4cc05d02eb","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hussarjs/pluggable/-/pluggable-1.0.9.tgz"},"contributors":[]},"1.0.13":{"name":"@hussarjs/pluggable","version":"1.0.13","description":"轻骑兵可插拔插件系统支持库","main":"dist/index.js","module":"dist/pluggable.esm.js","typings":"dist/index.d.ts","files":["dist","build","package.json"],"keywords":["vue","vue-plugins","vue-pluggable","plugin","plugin-ecosystem","vue-ecosystem"],"scripts":{"start":"tsdx watch","build":"tsdx build","lint":"tsdx lint","prepare":"tsdx build"},"author":{"name":"轻骑兵前端架构团队"},"license":"ISC","peerDependencies":{"vue":">= 2.7.14"},"dependencies":{},"devDependencies":{"vue":"^2.7.14","@types/semver":"^7.3.2","@typescript-eslint/eslint-plugin":"^5.59.1","@vue/compiler-sfc":"^2.7.14","vue-template-compiler":"^2.7.14","rollup-plugin-vue":"^5.0.0","semver":"^7.3.2","tsdx":"^0.13.3","tslib":"^2.0.1","typescript":"^4.0.2","vue-demi":"^0.14.10"},"readmeFilename":"README.md","_id":"@hussarjs/pluggable@1.0.13","_integrity":"sha512-4rV4KAxh8/SvlFckI1bViiF+x8Eup0wX/1EeJw1FgOZu5REbWS2c1d4CJwDiGlZcyEUfW6TxufYk5MzOsoCWMg==","_resolved":"/var/jenkins_home/workspace/fusion/common/front-npm-transfer/packages/@hussarjs_pluggable@1.0.13.tgz","_from":"file:/var/jenkins_home/workspace/fusion/common/front-npm-transfer/packages/@hussarjs_pluggable@1.0.13.tgz","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-4rV4KAxh8/SvlFckI1bViiF+x8Eup0wX/1EeJw1FgOZu5REbWS2c1d4CJwDiGlZcyEUfW6TxufYk5MzOsoCWMg==","shasum":"2def95089f7d3c51b84ed00994fd3a83bdd79ed3","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hussarjs/pluggable/-/pluggable-1.0.13.tgz"},"contributors":[]},"2.0.0-beta.5":{"name":"@hussarjs/pluggable","version":"2.0.0-beta.5","description":"轻骑兵可插拔插件系统支持库","main":"dist/index.js","module":"dist/pluggable.esm.js","typings":"dist/index.d.ts","files":["dist","build","package.json"],"keywords":["vue","vue-plugins","vue-pluggable","plugin","plugin-ecosystem","vue-ecosystem"],"scripts":{"start":"tsdx watch","build":"tsdx build","lint":"tsdx lint","prepare":"tsdx build"},"author":{"name":"轻骑兵前端架构团队"},"license":"ISC","peerDependencies":{"vue":">= 2.7.14","@hussar/api":">= 1.0.0","@hussar/core-extensions":">= 1.0.0"},"dependencies":{},"devDependencies":{"@types/semver":"^7.3.2","@typescript-eslint/eslint-plugin":"^5.59.1","@vue/compiler-sfc":"2.7.14","vue-template-compiler":"2.7.14","rollup-plugin-vue":"^5.0.0","semver":"^7.3.2","tsdx":"^0.13.3","tslib":"^2.0.1","typescript":"^4.0.2","vue-demi":"^0.14.10"},"readmeFilename":"README.md","_id":"@hussarjs/pluggable@2.0.0-beta.5","_integrity":"sha512-s+c6GKnkO3hD8AabsKW7ihkQvFjTb+H7rs0Fcl2R6+el0AEVxVBtznesA1KPyfpmhCtBc6Frej0LgSyjwQ7pLw==","_resolved":"/var/jenkins_home/workspace/fusion/common/front-npm-transfer/packages/@hussarjs_pluggable@2.0.0-beta.5.tgz","_from":"file:/var/jenkins_home/workspace/fusion/common/front-npm-transfer/packages/@hussarjs_pluggable@2.0.0-beta.5.tgz","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-s+c6GKnkO3hD8AabsKW7ihkQvFjTb+H7rs0Fcl2R6+el0AEVxVBtznesA1KPyfpmhCtBc6Frej0LgSyjwQ7pLw==","shasum":"7ba11d6097d876b503b6e5f6111b546ed15f61be","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@hussarjs/pluggable/-/pluggable-2.0.0-beta.5.tgz"},"contributors":[]}},"dist-tags":{"latest":"2.0.0-beta.5"},"name":"@hussarjs/pluggable","time":{"modified":"2026-04-25T03:04:08.151Z","created":"2025-08-20T10:35:13.073Z","1.0.3":"2025-08-20T10:35:13.073Z","1.0.4":"2025-08-21T10:07:17.199Z","1.0.5":"2025-08-25T03:31:29.234Z","1.0.6":"2025-08-25T06:18:54.627Z","1.0.7":"2025-08-25T07:49:16.630Z","1.0.8":"2025-08-26T03:55:49.623Z","1.0.9":"2025-09-01T06:29:17.834Z","1.0.13":"2025-10-13T05:41:52.789Z","2.0.0-beta.5":"2026-04-25T03:04:08.151Z"},"readme":"# 轻骑兵可插拔插件系统\n\n文档：http://192.168.2.92:8001/hussarjs-pluggable/\n\n### 1) 介绍\n\n虽然 Vue 本身在某种程度上是一个插件系统，但它专注于 UI 的抽象。它本质上是声明性的，这使得开发人员在构建 UI 时很直观。在 HussarJS Pluggable 的帮助下，我们可以将应用程序视为一组功能，而不是一组组件。 它提供了一种混合的方法来解决这个问题。\n\n### 2) 动机\n\n在Vue中，所有都是组件，如果我们想添加一个新的功能，我们会创建一个新的组件并将其添加到我们的应用程序中。但往往一个一个特性功能不只是一个组件就能解决，可能会有多个组件和组件外的JS处理逻辑。\n\n每次我们必须启用/禁用一个功能时，我们都必须从整个应用程序中添加/删除该组件，当我们需要在一个复杂的应用程序中工作时，改功能会涉及好几个地方分散在各处，使其改造起来会很麻烦，因为很多功能是不同的开发人员做的，不易分析影响范围，因为你引入的组件可能被其他功能引用也是有可能。\n\n我们要提供一种方式，如何从一个地方为整个应用程序注册功能，并且方便启用和禁用对应功能，并且只需要一行代码就能做到一个特性功能的启用和禁用。\n\n使用插件简化了该问题，只需3步：\n\n1. 要在应用程序中添加新功能，只需要编写它的逻辑并将其安装在插件商店（pluginStore）中。\n\n2. 通过PluginStore调用该功能，而不是直接导入该功能，可以在应用任何位置使用该功能。\n\n3. 如果不想在应用程序中使用某个特性功能，只需要再插件商店卸载它或注释插件安装即可。\n\n### 3) 安装 \n\n```\nnpm install @hussarjs/pluggable\nyarn add @hussarjs/pluggable\n```\n\n### 4) 创建插件商店\n\nsrc/pluginStore/index.js\n\n```js\nimport Vue from 'vue'\nimport Pluggable, { createPluginStore } from '@hussarjs/pluggable'\n\nVue.use(Pluggable)\n\nconst pluginStore = createPluginStore();\n\n\nexport pluginStore;\n```\n\nsrc/main.js\n\n```js\nimport pluginStore from './pluginStore.js';\n\nnew Vue({\n  el: 'app',\n  pluginStore,\n})\n```\n\n\n### 5) 使用\n\n#### 执行JS函数\n\n在应用程序内部的任何位置，能执行插件注册的JS函数。  \n\n对于逻辑处理很有用，比如：\n\n- 集成微信SDK\n- 外部自定义跳转逻辑。\n- 不开放子包源码情况下，对子包功能进行扩展。\n- 通过插件集成路由页面，如文档、OCR等非核心功能。\n\n**1. 创建插件**\n\nShowAlertPlugin.js\n\n```ts\nimport { JSPlugin, PluginStore } from '@hussarjs/pluggable';\n\nclass ShowAlertPlugin extends JSPlugin {\n  name = 'show-alert-plugin'; // 声明唯一的插件名称\n  version = '1.0.0'; // 插件版本\n  constructor() {\n    super();\n  }\n\n  activate() {\n    this.addFunction('sendAlert', (message: string) => {\n      alert('Hello from the ShowAlert Plugin, Message = ' + message);\n    });\n  }\n\n  deactivate() {\n    this.removeFunction('sendAlert');\n  }\n}\n\nexport default ShowAlertPlugin;\n```\n\n**2.安装插件**\n\nsrc/pluginStore/index.js\n\n```js\nimport Vue from 'vue'\nimport Pluggable, { createPluginStore } from '@hussarjs/pluggable'\n// 1. 导入插件\nimport ShowAlertPlugin from './ShowAlertPlugin.ts'\n// 2. 安装VUE插件\nVue.use(Pluggable)\n// 3. 创建插件商店\nconst pluginStore = createPluginStore();\n// 4. 安装插件\npluginStore.install(new ShowAlertPlugin()); \n\nexport pluginStore;\n```\n\n**3.调用插件**\n\n> 在应用中任何位置使用$pluginStore插件方法。\n\nTest.vue\n\n```js\nimport { defineComponent } from 'vue'\ndefineComponent({\n  name: 'Test',\n  render() {\n    return (\n      <button\n          onClick={() => {\n            this.$pluginStore.js.execFunction('sendAlert', 'HelloWorld');\n          }}\n        >\n          Show Alert\n        </button>\n    );\n  }\n})\n```\n\n#### 渲染组件\n\n通过插件扩展应用程序的UI功能，如添加新的页面、按钮。\n\n应用场景有：\n- 集成非核心的系统页面，如：文档、OCR页面等。\n- 子包功能扩展，如权限字段扩展。\n- 集成非核心系统功能，如：AI，在私有化部署时，客户不需要的功能，通过插件集成能一键卸载。\n\n**1. 使用内建渲染器**\n\n> 关联渲染插件\n\nAboutPlugin.js\n\n```js\nimport { UIPlugin } from '@hussarjs/pluggable';\n\nclass AboutPlugin extends UIPlugin {\n  name = \"about-plugin\";\n  version = \"1.0.0\";\n  constructor() {\n    super();\n  }\n\n  getDependencies() {\n    return [];\n  }\n\n  aboutComponent = () => import(\"../components/IAbout1.vue\"),\n\n  activate() {\n    this.addComponentInPosition(\"about\", this.aboutComponent);\n  }\n\n  deactivate() {\n    this.removeComponentInPosition(\"about\", this.aboutComponent);\n  }\n}\n\nexport default AboutPlugin;\n\n\n```\n\n**2. 安装渲染插件**\n\n```js\nimport Vue from 'vue'\nimport Pluggable, { createPluginStore } from '@hussarjs/pluggable'\n// 1. 导入插件\nimport AboutPlugin from './AboutPlugin.js'\nVue.use(Pluggable)\nconst pluginStore = createPluginStore();\n\n// 2. 安装渲染插件\npluginStore.install(new AboutPlugin()); \n\nexport pluginStore;\n```\n\n\n**3. 渲染插件代理**\n\n> \n> 使用全局组件`<plugin-renderer position=\"about\"/>` 通过placement属性指定渲染位置\n> \n> 在该组件渲染时会调用`addComponentInPosition('about', () => import('./IAbout.vue'));`渲染异步组件。\n> \n> 通过`position`属性指定渲染位置\n> \n\nHelloWorld.vue\n\n```vue\n<template>\n  <div>\n    <plugin-renderer position=\"about\" />\n  </div>\n</template>\n<script>\nexport default {\n  name: 'App'\n}\n</script>\n\n```\n\n**4.渲染插件优先级问题**\n\n> 内建渲染器默认优先级为0，安装安装插件的先后顺序进行渲染。\n> \n> 可以在同一个位置渲染多个组件，通过priority属性指定渲染优先级，优先级高的会排列在前面。\n>\n> 可以通过override属性指定是否覆盖已有的组件。如果设置override=true，则需要设置高权重priority，使其排在[0]位置。\n\nAboutPlugin2.js\n\n```js\n\nimport { UIPlugin } from '@hussarjs/pluggable';\nclass AboutPlugin2 extends UIPlugin {\n  name = \"about-plugin2\";\n  version = \"1.0.0\";\n  constructor() {\n    super();\n  }\n\n  getDependencies() {\n    return [];\n  }\n\n  aboutComponent = () => import('../components/IAbout2.vue'),\n\n  activate() {\n    // 在about位置渲染IAbout2组件，优先级为1\n    // 未设置默认优先级为0，按照插件安装顺序排列。\n    this.addComponentInPosition(\"about\", this.aboutComponent, { priority: 1 });\n  }\n\n  deactivate() {\n    this.removeComponentInPosition(\"about\", this.aboutComponent);\n  }\n}\n\nexport default AboutPlugin2;\n\n```\n\npluginStore.js\n\n```js\npluginStore\n  .install(new AboutPlugin())\n  .install(new AboutPlugin2()) // 后注册，about位置渲染IAbout2组件会排列在IAbout1前面\n```\n\n## pluggable-config-loader\n\n插件配置加载器\n\n避免手动修改源码，通过配置文件加载插件。\n\n在项目pluginStore.js可以不用引入插件进行安装，通过配置文件加载插件。\n\n> 插件配置文件默认从项目根目录读取pluggable.config.js文件。\n\n**1. 在项目根目录添加sys.pluggable.config.js文件**\n\n- 单入口项目\n\n```js\nmodule.exports  = {\n  plugins: [\n    {\n      name: 'AboutPlugin',\n      plugin: path.resolve(__dirname, './src/IPlugins/AboutPlugin.js'), // 使用绝对路径\n    },\n    {\n      name: 'HelloWorld',\n      plugin: './src/IPlugins/HelloWorld.js', // 插件相对项目根目录文件路径\n    },\n    {\n      name: 'HussarLoginPlugin',\n      plugin: 'hussar-plugin-login', // 插件npm包名\n    },\n  ]\n}\n```\n\n- 多入口项目\n\n```js\nmodule.exports  = {\n  // 门户\n  index: {\n    plugins: [\n      {\n        name: 'AboutPlugin',\n        plugin: path.resolve(__dirname, './src/IPlugins/AboutPlugin.js'), // 使用绝对路径\n      },\n      {\n        name: 'HelloWorld',\n        plugin: './src/IPlugins/HelloWorld.js', // 插件相对项目根目录文件路径\n      },\n      {\n        name: 'HussarLoginPlugin',\n        plugin: 'hussar-plugin-login', // 插件npm包名\n      },\n    ]\n  },\n  // 控制台\n  console: {\n    plugins: [\n      {\n        name: 'AboutPlugin',\n        plugin: path.resolve(__dirname, './src/IPlugins/AboutPlugin.js'), // 使用绝对路径\n      },\n      {\n        name: 'HelloWorld',\n        plugin: './src/IPlugins/HelloWorld.js', // 插件相对项目根目录文件路径\n      },\n      {\n        name: 'HussarLoginPlugin',\n        plugin: 'hussar-plugin-login', // 插件npm包名\n      },\n    ]\n  }\n}\n```\n\n\n**2. 配置plugin.config-loader**\n\n**单页面项目**\n\n```js\nconfigureWebpack: (config) => {\n    return {\n      module: {\n        rules: [\n          {\n            test: /src\\/main\\.js$/, // 入口文件，一般是src/main.js, 如果是多入口项目，可以配置多个loader，分别匹配。\n            use: [\n              {\n                loader: require.resolve('@hussarjs/pluggable/build/pluggable-config-loader'),\n                options: {\n                  // App插件配置路径，默认从项目根目录读取pluggable.config.js\n                  configPath: './sys.pluggable.config.js', \n                  // 用户插件配置路径，默认从项目根目录读取user.pluggable.config.js\n                  userConfigPath: './user.pluggable.config.js', \n                  // userConfigPath: path.resolve(process.cwd(), './user.pluggable.config.js'), // 如果是其他路径可以配置绝对路径\n                },\n              },\n            ],\n          },\n        ],\n      }\n    }\n  }\n```\n\n**多入口项目**\n\n```js\nconfigureWebpack: (config) => {\n    return {\n      module: {\n        rules: [\n          {\n            test: /src\\/page\\/index\\/index\\.js$/, // 门户入口文件\n            use: [\n              {\n                loader: require.resolve('@hussarjs/pluggable/build/pluggable-config-loader'),\n                options: {\n                  app: 'index', // 入口的名称要和pluggable.config.js中的入口名称一致\n                  configPath: './sys.pluggable.config.js', \n                  userConfigPath: './user.pluggable.config.js', \n                },\n              },\n            ],\n          },\n        ],\n        rules: [\n          {\n            test: /src\\/page\\/console\\/index\\.js$/, // 控制台入口文件\n            use: [\n              {\n                loader: require.resolve('@hussarjs/pluggable/build/pluggable-config-loader'),\n                options: {\n                  app: 'console',\n                  configPath: './sys.pluggable.config.js',\n                  userConfigPath: './user.pluggable.config.js',\n                },\n              },\n            ],\n          },\n        ],\n      }\n    }\n  }\n```","users":{}}