Home>Article>WeChat Applet> Summarize and organize common form components of WeChat mini programs
This article brings you relevant knowledge aboutWeChat Mini Program, which mainly introduces some common form components, including button, checkbox, input, label and other related issues. The following is Let's take a look, hope it helps everyone.
【Related learning recommendations:小program learning tutorial】
is a button component, which is one of the commonly used form components and is used for event triggering and form submission. Its attribute table is shown below.
Code example:
7.button小案例 (1)迷你按钮 (2)按钮状态 (3)增加按钮事件
1.2 checkbox
is a check box component, often used to select multiple data in a form. The
of the check box is the parent control, and several
child controls are nested inside it.
The attributes are as follows:
##
Code example:
checkbox.js8.checkbox小案例 利用for循环批量生成
Page({ data: { items: [ { name: "tiger", value: "老虎" }, { name: "elephant", value: "大象" }, { name: "lion", value: "狮子", checked: "true" }, { name: "penguin", value: "企鹅" }, { name: "elk", value: "麋鹿" }, { name: "swan", value: "天鹅" }, ] }, checkboxChange:function(e) { console.log("checkbox发生change事件,携带value值为:", e.detail.value) }})
1.3 input
9.input小案例 (1)文字输入框 (2)密码输入框 (3)禁用输入框 (4)为输入框增加事件监听
1.4 label
wxml
1.5 form is the form control component, used to submit the form content in the component.10.lable小案例 (1)利用for属性 (2)label包裹组件
The above is the detailed content of Summarize and organize common form components of WeChat mini programs. For more information, please follow other related articles on the PHP Chinese website!