当前位置:网站首页>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"
}
}
}
}边栏推荐
- Regular expressions and re Libraries
- Database recovery strategy
- Poj 3237 Tree (Tree Chain Split)
- Codeforces 12D ball tree array simulation 3 sorting elements
- Livelocks and deadlocks of concurrency control
- [Yugong series] go teaching course in July 2022 004 go code Notes
- Index optimization of performance tuning methodology
- Advantages and disadvantages of the "Chris Richardson microservice series" microservice architecture
- POJ 3237 tree (tree chain splitting)
- Three components of openpyxl
猜你喜欢

Some common processing problems of structural equation model Amos software

Cold violence -- another perspective of objective function setting

Type of fault

Implementation technology of recovery

Official clarification statement of Jihu company

Database recovery strategy

MMAP learning

An exception occurred in Huawei game multimedia calling the room switching method internal system error Reason:90000017

Summarize the reasons for 2XX, 3xx, 4xx, 5xx status codes

华为云ModelArts文本分类–外卖评论
随机推荐
HDU 4391 Paint The Wall 段树(水
Oracle检查点队列–实例崩溃恢复原理剖析
Cross end solutions to improve development efficiency
oracle 控制文件的多路复用
他们主动布局(autolayout)环境的图像编辑器
多家呼吸机巨头产品近期被一级召回 呼吸机市场仍在增量竞争
2.2.3 output of documents
Interprocess communication in the "Chris Richardson microservice series" microservice architecture
A long's perception
Granularity of blocking of concurrency control
Implementing Lmax disruptor queue from scratch (IV) principle analysis of multithreaded producer multiproducersequencer
Environment configuration problem record
The real situation of programmers
深信服X计划-网络协议基础 DNS
微服务入门(RestTemplate、Eureka、Nacos、Feign、Gateway)
Countdown to 92 days, the strategy for the provincial preparation of the Blue Bridge Cup is coming~
Ad637 notes d'utilisation
Image editor for their AutoLayout environment
Two stage locking protocol for concurrency control
Microservice link risk analysis