2.5.1 • Published 2 months ago

@wxa/plugin-global-component-inject v2.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

:blush::blush::blush::blush:Documentation

wxa-plugin-replace

NPM version

:tada:向所有页面注入组件

Usage

//wxa.config.js
const {
  InjectCompileTimePlugin,
} = require("@wxa/plugin-global-component-inject/compile");
new InjectCompileTimePlugin([
  { path: "/components/comp.wxa", name: "injectComp" },
]);

//app.wxa
import { runtimePlugin } from "@wxa/plugin-global-component-inject";
wxa.use(runtimePlugin);
// when you have *this* of Component or Page
this.getInjectedComponent("injectComp");
this.invokeInjectedComponent("injectComp", "args1", "args2");
// or
import { helpers } from "@wxa/plugin-global-component-inject";
helpers.get("injectComp");
helpers.invoke("injectComp", null, "args");
2.5.1

2 months ago

2.4.1

2 years ago

2.3.0-alpha.34

2 years ago

2.3.1

2 years ago