Skip to content

全局组件注入

小程序下将 app.json 中出现的全局组件,即 usingComponents,注入到每个页面/组件的 usingComponents 中。已不建议使用。

如何使用

安装

bash
pnpm add @plugin-light/webpack-plugin-insert-global-comp -D

vue.config.js 中添加如下设置:

ts
const { InsertGlobalCompPlugin } = require('@plugin-light/webpack-plugin-insert-global-comp');


module.exports = {
  configureWebpack: {
    plugins: [new InsertGlobalCompPlugin({
      namespace: 'convert-cross',
    })],
  }
}

类型

ts
export interface IInsertGlobalCompOptions {
  namespace?: string;
}

更新日志

点此查看