Component

Basic Component

The Mini Program provides the developers with a series of basic components so that the developers can combine them for service development.

Attribute Type

The component provides a series of attribute configuration. Each attribute value has the requirement for type:

Type

Description

Notes

Boolean

Boolean

Number

Number

String

String

Array

Array

Object

Object

EventHandle

Event handler

Need to define the implementation for the event handler in Page

.

any

Any type

Common Component Attribute

All components include the following attributes:

Property

Type

Description

Notes

id

String

Unique component identifier.

class

String

Style class.

style

String

Inline style.

data-*

Any

Custom attributes.

When the event is triggered, the custom attribute is transferred to the event handler.

on
catch

EventHandle

Event binding, following the ump nomenclature specifications, such as  onTap.

Refer to event

.

Tips

The {{}} is required to transfer inside the specified attribute type data. For example

copy
<view disable-scroll="false"> <!-- Error is a string, not a boolean, equivalent to boolean type true -->
<view disable-scroll="{{false}}"> <!--right, or empty attribute, meaning false-->