QR code

Updated at:

Introduction

The QR code widget is a software module that you can use to generate, read, and manage QR codes in various scenarios.

image

Configuration items

Category

Configuration

Example

Description

Content

Text

image

The information displayed when the QR code is scanned. Note: If the content is too long, the recognition rate can be affected by the QR code icon, error correction level, and the contrast between the QR code color and background color.

QR code icon

The three patterns for the QR code icon. The icon is usually displayed in the center of the QR code.

URL

image

This takes effect when the source of the QR code icon is a URL. The value is the link to the icon.

System file

This takes effect when the source of the QR code icon is a system file. Select an icon uploaded in the built-in resource files, or click the box below to upload one directly.

Memory object

image

This takes effect when the source of the QR code icon is a memory object. It can be used with an upload widget. For example, upload1.values?.[0]. This is useful for scenarios where an actual upload is not required.

Error correction level

The error correction level of a QR code refers to its ability to be successfully scanned and decoded even when it is damaged or partially unreadable. There are four main error correction levels:

  1. Level L: Allows up to 7% of the QR code data to be damaged or obscured.

  2. Level M: Allows up to 15% of data corruption and is widely applicable.

  3. Level Q: Allows up to 25% of data corruption and provides higher fault tolerance.

  4. Level H: Allows up to 30% of data corruption. It is suitable for use in extreme environments or under strong interference.

Status

Displays the current status of the QR code widget. The key-value pairs for different statuses are:

  • Active -> active

  • Expired

  • Loading -> loading

  • Scanned -> scanned

Interaction

Hidden

Controls the default display state of the QR code widget. When set to true, the widget is hidden. For more information, see Common properties

Style

Margin

For more information, see Common properties

Show border

Does the outer layer of the QR code have a border?

CSS Style

QR code color

The color of the QR code part.

QR code background color

The background color of the QR code.

Properties and methods

Name

Type

Example

Description

value

string

qRCode1.value

The scan text of the current QR code widget.

status

string

qRCode1.status

The current status of the QR code widget.

src

string

qRCode1.src

Read-only. The link to the QR code icon.

file

object

qRCode1.file

Read-only. The QR code icon file resource.

image

string

qRCode1.image

Read-only. The data of the QR code converted into an image.

setValue

func

qRCode1.setValue('QR code text')

Sets the QR code content to QR code text.

clearValue

func

qRCode1.clearValue()

Clears the QR code content.

setStatus

func

qRCode1.setStatus('active')

Sets the QR code status to active.

clearStatus

func

qRCode1.clearStatus()

Clears the QR code status.

download

func

qRCode1.download()

Downloads the QR code image.

Event callbacks

Configuration

Description

The event that is triggered when Refresh is clicked.