index.axml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <view class='page-container-classname' ref='saveChildRef0'>
  2. <demo-block title='基础用法' padding=" " ref='saveChildRef1'>
  3. <van-uploader name='1' file-list='{{ fileList1 }}' onAfter-read='afterRead' onDelete='delete' onClick-preview='clickPreview' ref='saveChildRef2'>
  4. </van-uploader>
  5. </demo-block>
  6. <demo-block title='上传视频' padding=" " ref='saveChildRef3'>
  7. <van-uploader name='7' accept='video' file-list='{{ fileList7 }}' onAfter-read='afterRead' onDelete='delete' ref='saveChildRef4'>
  8. </van-uploader>
  9. </demo-block>
  10. <demo-block title='文件预览' padding=" " ref='saveChildRef5'>
  11. <van-uploader name='2' file-list='{{ fileList2 }}' multiple=" " onAfter-read='afterRead' onDelete='delete' onClick-preview='clickPreview' ref='saveChildRef6'>
  12. </van-uploader>
  13. </demo-block>
  14. <demo-block title='隐藏上传按钮' padding=" " ref='saveChildRef7'>
  15. <van-uploader name='2' file-list='{{ fileList2 }}' multiple=" " show-upload='{{ false }}' onAfter-read='afterRead' onDelete='delete' onClick-preview='clickPreview' ref='saveChildRef8'>
  16. </van-uploader>
  17. </demo-block>
  18. <demo-block title='上传状态' padding=" " ref='saveChildRef9'>
  19. <van-uploader name='8' file-list='{{ fileList8 }}' multiple=" " max-count='{{ 2 }}' onAfter-read='afterRead' onDelete='delete' onClick-preview='clickPreview' ref='saveChildRef10'>
  20. </van-uploader>
  21. </demo-block>
  22. <demo-block title='限制上传数量' padding=" " ref='saveChildRef11'>
  23. <van-uploader name='3' file-list='{{ fileList3 }}' multiple=" " max-count='{{ 2 }}' onAfter-read='afterRead' onDelete='delete' onClick-preview='clickPreview' ref='saveChildRef12'>
  24. </van-uploader>
  25. </demo-block>
  26. <demo-block title='自定义上传样式' padding=" " ref='saveChildRef13'>
  27. <van-uploader name='4' file-list='{{ fileList4 }}' max-count='{{ 2 }}' use-slot='{{ true }}' onAfter-read='afterRead' onDelete='delete' onClick-preview='clickPreview' ref='saveChildRef14'>
  28. <van-button icon='photo' type='primary' ref='saveChildRef15'>
  29. 上传图片
  30. </van-button>
  31. </van-uploader>
  32. </demo-block>
  33. <demo-block title='上传前校验' padding=" " ref='saveChildRef16'>
  34. <van-uploader name='5' file-list='{{ fileList5 }}' use-before-read='{{ true }}' onBefore-read='beforeRead' onAfter-read='afterRead' onDelete='delete' onClick-preview='clickPreview' ref='saveChildRef17'>
  35. </van-uploader>
  36. </demo-block>
  37. <demo-block title='云存储上传' padding=" " ref='saveChildRef18'>
  38. <van-uploader name='6' file-list='{{ fileList6 }}' use-before-read='{{ true }}' onBefore-read='beforeRead' onAfter-read='afterRead' onDelete='delete' onClick-preview='clickPreview' ref='saveChildRef19'>
  39. </van-uploader>
  40. <view class='demo-margin-bottom'>
  41. <van-button type='primary' onClick='uploadToCloud' ref='saveChildRef20'>
  42. 上传至云存储
  43. </van-button>
  44. </view>
  45. </demo-block>
  46. </view>