# Basic components
A framework provides a set of foundational components for a developer that can be developed quickly by combining these foundational elements.For details, please refer to the component documentation .
What are components:
- Component is the basic building block of the view layer.
- The component comes with features that are consistent with the WeChat style.
- A component usually consists of a
start tagandEnd tag,Attributeto modify this component,Contentwithin both tags。
<tagname property="value">
Content goes here ...
</tagname>
Note: All components and properties are lowercase, connected by hyphens-
# Attribute Types
| type | describe | annotation |
|---|---|---|
| Boolean | Bullworth. | The component writes this property, and whatever value is taken astrue;The attribute value isfalseonly if the attribute is not on the component.If the attribute value is a variable, the value of the variable is converted to Boolean type |
| Number | digital | 1,2.5 |
| String | Character string | "string" |
| Array | array | [ 1, "string" ] |
| Object | object | { key: value } |
| EventHandler | Name of Event Processing Function | "handlerName"is the name of the event handler defined in Page |
| Any | Optional attributes |
# Public attributes
All components have the following attributes:
| Attribute Name | type | describe | annotation |
|---|---|---|---|
| id | String | A unique identifier for a component | Keep the entire page unique |
| class | String | Style classes for components | Style classes defined in the corresponding WXSS |
| style | String | Internal styles of components | Intranet styles that can be set dynamically |
| hidden | Boolean | Does the component display? | All components display by default |
| data-* | Any | Custom properties | When an event is triggered on a component, it is sent to an event handling function |
| bind*/ catch* | EventHandler | Event of a component | See Event |
# Special attributes
Almost all components have their own defined properties that can be modified to their functionality or style. Refer to the definitions of the component .