当前位置:网站首页>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"
}
}
}
}边栏推荐
- MySQL disconnection reports an error MySQL ldb_ exceptions. OperationalError 4031, The client was disconnected by the server
- Business learning of mall order module
- Net small and medium-sized enterprise project development framework series (one)
- Daily question brushing record (XIV)
- 微服务入门(RestTemplate、Eureka、Nacos、Feign、Gateway)
- Huawei cloud modelarts text classification - takeout comments
- 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
- Blocking of concurrency control
- Oracle检查点队列–实例崩溃恢复原理剖析
- Shell script, awk uses if, for process control
猜你喜欢

A number of ventilator giants' products have been recalled recently, and the ventilator market is still in incremental competition

Create a virtual machine on VMware (system not installed)

Decorator learning 01

database mirroring

Ad637 notes d'utilisation

Huawei fast game failed to call the login interface, and returned error code -1

Reptile practice

Daily question brushing record (XIV)

华为游戏多媒体调用切换房间方法出现异常Internal system error. Reason:90000017

Livelocks and deadlocks of concurrency control
随机推荐
Gcc9.5 offline installation
微服務鏈路風險分析
EL与JSTL注意事项汇总
Recovery technology with checkpoints
Countdown to 92 days, the strategy for the provincial preparation of the Blue Bridge Cup is coming~
How to view Apache log4j 2 remote code execution vulnerability?
Oracle checkpoint queue - Analysis of the principle of instance crash recovery
Detailed explanation of memset() function usage
ESP32
Matlab | app designer · I used Matlab to make a real-time editor of latex formula
A number of ventilator giants' products have been recalled recently, and the ventilator market is still in incremental competition
Implementing Lmax disruptor queue from scratch (IV) principle analysis of multithreaded producer multiproducersequencer
Sorting out the problems encountered in MySQL built by pycharm connecting virtual machines
Emotional analysis of wechat chat records on Valentine's day based on Text Mining
Interprocess communication in the "Chris Richardson microservice series" microservice architecture
CRM creates its own custom report based on fetch
Official clarification statement of Jihu company
从零开始实现lmax-Disruptor队列(四)多线程生产者MultiProducerSequencer原理解析
poj 3237 Tree(樹鏈拆分)
NET中小型企业项目开发框架系列(一个)