Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to develop Mini Program plug-in

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

In this article, the editor introduces in detail "how to develop the Mini Program plug-in". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to develop the Mini Program plug-in" can help you solve your doubts. Let's go deep into the editor's train of thought and learn new knowledge together.

A plug-in is an encapsulation of a set of js interfaces or custom components that are provided to third-party Mini Program calls. The plug-in must be embedded in other Mini Program before it can be used by users.

Plug-in developers can write a plug-in and upload code just like Mini Program, and other Mini Program can only call it after the plug-in is released. Mini Program platform will host plug-in code, and when other Mini Program calls, the uploaded plug-in code will be downloaded and run with Mini Program.

Quick launch template description:

Miniprogram folder is an ordinary Mini Program project, which is used to write Mini Program plug-ins using Demo. When uploading plug-in code, the Demo will be uploaded together and used as a basis for auditing the release of Mini Program plug-ins.

The plugin file is the Mini Program plug-in project, which is used to write the Mini Program plug-in code.

Project.config.json needs to pay attention to the compileType field, compileType = = 'plugin' in order to use the plug-in project normally.

Open an existing plug-in project

If it is a previously created plug-in project, you can open it directly in the project list

If you recreate the project and select a non-empty directory, you need to have project.config.json in the non-empty directory. Make sure the following fields are in the file:

{

MiniprogramRoot: ". / miniprogram"

PluginRoot: ". / plugin"

"compileType": "plugin"

}

During project development, you can manually modify the compileType field of the project.config.json file to switch the compilation type of the project.

Plug-in upload

Before uploading the plug-in code, you need to specify the version number and the format is a number. A number. Numbers, each up to 999.

Each submission version number needs to be incremented, plug-in users will use this version number, please fill in carefully.

When uploading a plug-in, the contents of the directory specified by miniprogramRoot in project.config.json will be uploaded together with Demo as a plug-in. This Demo needs to cover all usage scenarios of the plug-in to facilitate its review.

Plug-in use

You can declare the use of plug-ins in the plugins field of app.json of the Mini Program project. If the current compilation type is Mini Program, you need to specify the version number of the released plug-in, and the developer tool will pull the corresponding version of the plug-in to compile according to the version number.

The version number of the plug-in can be 'dev' only if the compileType of project.config.json = =' plugin'

After reading this, the article "how to develop Mini Program plug-ins" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report