Entrance
In the bottom right corner of the plugin, click the settings button.

Configuration items
You can set transcoding and picture-related configurations on the configuration page.
configuration item | description | interface |
---|---|---|
Transcoding Mode | Optional transcoding mode. After tailwind is enabled, you will not be able to preview it, you can copy the code to the project to view the effect | 'jsx+scss' | 'jsx+tailwind' |
Copy code mode | file contains components and references, template contains only template code | 'file' | 'template' |
Show copy JSON button | Whether to show copy JSON button on transcoding page | boolean |
Image Interface | When customizing the image upload interface, select custom | 'default' | 'custom' |
Image Interface configuration | When customizing the image upload interface, you can pass the authentication token of the layer through the custom header or custom body | ImageUploadConfig |
ImageUploadConfig
Custom image interface
The image upload interface is used to upload images, js, css, and json files during transcoding. The files uploaded by the default interface of the community version plug-in will only be saved for 3 hours. If you need to store them for a longer period of time, you need to customize the image upload service.
Authentication
You can choose the following methods for authentication, which will be transparently transmitted to the interface you requested after configuration:
- query: directly splicing the authentication token into the URL
- header: pass the authentication token through the header
- body: pass the authentication token through the body
Interface return
The interface return value needs to contain the url of the picture, and the types are as follows.
Example
Below is an example of passing token in body.
- Note that the request body is encoded by multipart/form-data, so you need a corresponding library to parse the request body. In the example below, we use the koa-body library.
- When processing files, please note that the key of the file is 'file'. Other fields of the request body are customized by you.