常用组件
表单组件
1.button
// 在list3.wxml中
```javascript
// <view>通过type指定按钮类型</view>
<button>普通按钮</button>
<button type="primary">主按钮</button>
<button type="warn">警告按钮</button>
<view>......size="mini"小尺寸按钮....</view>
<button size="mini">普通按钮</button>
<button type="primary" size="mini">主按钮</button>
<button type="warn" size="mini">警告按钮</button>
<view>.....plain镂空按钮.......</view>
<button plain>普通按钮</button>
<button type="primary" plain>主按钮</button>
<button type="warn" plain>警告按钮</button>
<view>..............</view>
<button type="warn" loading>加载中</button>
<button disabled>登录</button>
<button type="primary" disabled="{
{false}}">登录</button>
<button open-type="contact">客服对话</button>
效果如下:
当点击客服对话时,需要真机调试,效果为:
在button组件中有个form-type属性用于客户提交信息,需要结合form组件。具体案例看后面。
2.form
//在wxml中
//
<button type="warn" loading>加载中</button>
<button disabled>登录</button>
<button type="primary" disabled="{
{false}}">登录</button>
<button open-type="contact">客服对话</button>
<form bindsubmit="onsubmit">
<button form-type="submit">提交</button>
</form>
效果如图: