Home> Web Front-end> uni-app> body text

How to obtain the uniapp applet plug-in after subcontracting

下次还敢
Release: 2024-04-06 03:51:21
Original
1201 people have browsed it

The UniApp applet supports plug-in subcontracting. After subcontracting, the plug-in can be independently released and updated. The steps to obtain the subcontracted plug-in include: referencing the subcontracted plug-in in the main package manifest.json; using the is attribute in the page to use the subcontracted plug-in; obtaining the subcontracted plug-in instance through getPluginManager().getPlugin(pluginId); the subcontracted plug-in is not When loading, you can pass in a callback function to obtain the instance asynchronously.

How to obtain the uniapp applet plug-in after subcontracting

How to obtain the UniApp applet plug-in after subcontracting

The UniApp applet supports plug-in subcontracting. After subcontracting Plugins can be released and updated independently of the main package. To obtain the plug-in in the sub-package, you can follow the following steps:

1. Reference the sub-package plug-in in the main package

In themanifest of the main package Add a reference to the subpackaging plug-in in the .jsonfile, for example:

{ "usingComponents": { "my-plugin": "../packages/my-plugin/index" } }
Copy after login

2. Use the subpackaging plug-in in the page

In the page, you can pass Theisattribute in