# Basic components
The framework provides developers with a set of basic components that they can combine for rapid development. Please refer to theComponent documentation。
What is a component:
- Components are the basic building blocks of visual layers.
- Components come with some features consistent with WeChat style.
- A component usually consists of
Start Tab
andEnd Tag
,attribute
To decorate this component,content
Within two labels.
<Tagname property="value">
Content goes Here ...
</Tagname >
Note: All components and properties are lowercase, hyphenated-
Connect
# Attribute type
type | describe | annotation |
---|---|---|
Boolean | Boolean value | Component writes the property, whatever the value is treated as true The property value is only if the property is not present on the componentfalse 。If the attribute value is a variable, the value of the variable is converted to a Boolean type |
Number | digital | 1 , 2.5 |
String | Character string | "string" |
Array | array | [ 1, "string" ] |
Object | object | { key: value } |
EventHandler | Event handler name | "handler" yes Page The event handler name defined in |
Any | Any attribute |
# Public property
All components have the following properties:
Attribute name | type | describe | annotation |
---|---|---|---|
id | String | Unique identification of components | Keep the entire page unique. |
class | String | Style classes for components | In the corresponding WXSS The style classes defined in |
style | String | Inline styles for components | Inline styles that can be set dynamically |
hidden | Boolean | Does the component display | All components display by default |
data-* | Any | Custom Properties | Is sent to the event handler when an event is triggered on the |
bind* / catch* | EventHandler | The event of the component | See alsoevent |
# Special properties
Almost all components have their own defined properties that you can modify the functionality or style of the component.assemblyDefinition of.