Overview

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:

TypeDescriptionNotes
BooleanBoolean-
NumberNumber-
StringString-
ArrayArray-
ObjectObject-
EventHandleEvent handlerNeed to define the implementation for the event handler in Page
anyAny type-

Common Component Attribute

All components include the following attributes:

Attribute nameTypeDescriptionNotes
idStringUnique component identifier
classStringStyle class
styleStringInline style
data-*AnyCustom attributesWhen the event is triggered, the custom attribute is transferred to the event handler
on
catch
EventHandleEvent binding, following the ump nomenclature specifications, such as  onTapRefer 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-->