当前位置:网站首页>How to develop and introduce applet plug-ins
How to develop and introduce applet plug-ins
2022-07-05 22:01:00 【InfoQ】
1、 Applet plug-ins are introduced
2 Add the plug-in
3 Introduce plug-in code package
{
"plugins": {
"myPlugin": {
"version": "1.0.0",
"provider": " plug-in unit id"
}
}
}4 Introduce plug-in code package into subcontracting
{
"subpackages": [
{
"root": "packageA",
"pages": [
"pages/cat",
"pages/dog"
],
"plugins": {
"myPlugin": {
"version": "1.0.0",
"provider": " plug-in unit id"
}
}
}
]
}- The plug-in can only be used within this Subcontract ;
- The same plug-in cannot be referenced by multiple subcontractors at the same time ;
5 The use of plug-in
6 Custom components
{
"usingComponents": {
"hello-component": "plugin://myPlugin/hello-component"
}
}- By default , On the page this.selectComponent The interface cannot get the custom component instance object of the plug-in ;
- ft.createSelectorQuery And so on >>> The selector cannot be selected inside the plug-in .
7 page
<navigator url="plugin://myPlugin/hello-page">
Go to pages/hello-page!
</navigator>8 js Interface
var myPluginInterface = requirePlugin('myPlugin');
myPluginInterface.hello();
var myWorld = myPluginInterface.world;var myPluginInterface = requirePlugin(' plug-in unit id');9 Export to plug-in
{
"myPlugin": {
"version": "1.0.0",
"provider": " plug-in unit id",
"export": "index.js"
}
}// index.js
module.exports = { whoami: 'MiniProgram' }// plugin
requireMiniProgram().whoami // 'MiniProgram'10 Provide custom components for plug-ins
<!-- miniprogram/page/index.fxml -->
<plugin-view generic:mp-view="comp-from-miniprogram" />{
"myPlugin": {
"provider": " plug-in unit id",
"version": "1.0.0",
"genericsImplementation": {
"plugin-index": {
"mp-view": "components/comp-from-miniprogram"
}
}
}
}边栏推荐
- Analysis and test of ModbusRTU communication protocol
- EL与JSTL注意事项汇总
- Robot framework setting variables
- DataGrid directly edits and saves "design defects"
- Multiplexing of Oracle control files
- Yolov5 training custom data set (pycharm ultra detailed version)
- SQL knowledge leak detection
- How to use tensorflow2 for cat and dog classification and recognition
- EBS Oracle 11g 克隆步骤(单节点)
- Incentive mechanism of Ethereum eth
猜你喜欢

Analysis and test of ModbusRTU communication protocol

Yolov5 training custom data set (pycharm ultra detailed version)

The Blue Bridge Cup web application development simulation competition is open for the first time! Contestants fast forward!

Database recovery strategy

Incentive mechanism of Ethereum eth

Index optimization of performance tuning methodology

Countdown to 92 days, the strategy for the provincial preparation of the Blue Bridge Cup is coming~

Scenario interview: ten questions and ten answers about distributed locks

Some common processing problems of structural equation model Amos software

Experienced inductance manufacturers tell you what makes the inductance noisy. Inductance noise is a common inductance fault. If the used inductance makes noise, you don't have to worry. You just need
随机推荐
Poj3414 extensive search
MySQL disconnection reports an error MySQL ldb_ exceptions. OperationalError 4031, The client was disconnected by the server
"Chris Richardson microservices series" uses API gateway to build microservices
Reptile practice
MMAP
Incentive mechanism of Ethereum eth
Four components of logger
HDU 4391 paint the wall segment tree (water
database mirroring
Huawei game multimedia service calls the method of shielding the voice of the specified player, and the error code 3010 is returned
Huawei cloud modelarts text classification - takeout comments
Getting started with microservices (resttemplate, Eureka, Nacos, feign, gateway)
Oracle HugePages没有被使用导致服务器很卡的解决方法
Oracle checkpoint queue - Analysis of the principle of instance crash recovery
如何向mongoDB中添加新的字段附代码(全)
Implementation technology of recovery
大约SQL现场“这包括”与“包括在”字符串的写法
HYSBZ 2243 染色 (树链拆分)
Shell script, awk uses if, for process control
装饰器学习01