index.axml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <view class='page-container-classname' ref='saveChildRef0'>
  2. <demo-block title='基础用法' ref='saveChildRef1'>
  3. <van-cell-group ref='saveChildRef2'>
  4. <van-field value='{{ value }}' placeholder='请输入用户名' border='{{ false }}' clearable=" " ref='saveChildRef3'>
  5. </van-field>
  6. </van-cell-group>
  7. </demo-block>
  8. <demo-block title='自定义类型' ref='saveChildRef4'>
  9. <van-cell-group ref='saveChildRef5'>
  10. <van-field value='{{ username }}' label='用户名' placeholder='请输入用户名' clearable=" " right-icon='question-o' right-icon-class='custom-icon' required=" " onClick-icon='onClickIcon' ref='saveChildRef6'>
  11. </van-field>
  12. <van-field value='{{ password }}' type='password' label='密码' placeholder='请输入密码' required=" " border='{{ false }}' ref='saveChildRef7'>
  13. </van-field>
  14. </van-cell-group>
  15. </demo-block>
  16. <demo-block title='禁用输入框' ref='saveChildRef8'>
  17. <van-cell-group ref='saveChildRef9'>
  18. <van-field value='输入框已禁用' label='用户名' left-icon='contact' disabled=" " border='{{ false }}' ref='saveChildRef10'>
  19. </van-field>
  20. </van-cell-group>
  21. </demo-block>
  22. <demo-block title='错误提示' ref='saveChildRef11'>
  23. <van-cell-group ref='saveChildRef12'>
  24. <van-field value='{{ username2 }}' label='用户名' placeholder='请输入用户名' error=" " ref='saveChildRef13'>
  25. </van-field>
  26. <van-field value='{{ phone }}' label='手机号' placeholder='请输入手机号' error-message='手机号格式错误' border='{{ false }}' ref='saveChildRef14'>
  27. </van-field>
  28. </van-cell-group>
  29. </demo-block>
  30. <demo-block title='内容对齐方式' ref='saveChildRef15'>
  31. <van-cell-group ref='saveChildRef16'>
  32. <van-field value='{{ username3 }}' label='用户名' placeholder='请输入用户名' input-align='right' ref='saveChildRef17'>
  33. </van-field>
  34. </van-cell-group>
  35. </demo-block>
  36. <demo-block title='高度自适应' ref='saveChildRef18'>
  37. <van-cell-group ref='saveChildRef19'>
  38. <van-field value='{{ message }}' label='留言' type='textarea' placeholder='请输入留言' rows='1' autosize=" " border='{{ false }}' ref='saveChildRef20'>
  39. </van-field>
  40. </van-cell-group>
  41. </demo-block>
  42. <demo-block title='插入按钮' ref='saveChildRef21'>
  43. <van-cell-group ref='saveChildRef22'>
  44. <van-field value='{{ sms }}' center=" " clearable=" " label='短信验证码' placeholder='请输入短信验证码' use-button-slot=" " border='{{ false }}' ref='saveChildRef23'>
  45. <van-button slot='button' size='small' type='primary' custom-class='button' ref='saveChildRef24'>
  46. 发送验证码
  47. </van-button>
  48. </van-field>
  49. </van-cell-group>
  50. </demo-block>
  51. </view>