Crud 模块

图片显示

图片 - 图1

imgWidthimgHeight为图片的宽度和高度,imgFullscreen是否为全屏,imgType为展示图片类型

  1. <avue-crud :data="data" :option="option" ></avue-crud>
  2. <script>
  3. export default {
  4. data() {
  5. return {
  6. loading:true,
  7. data: [
  8. {
  9. img:'https://gitee.com/smallweigit/avue/badge/star.svg?theme=white',
  10. img1:[{
  11. label:'test',
  12. value:'http://pic.soutu123.com/back_pic/18/07/06/514e96eedb99a663e02ab32614713243.jpg!/fw/700/quality/90/unsharp/true/compress/true',
  13. },{
  14. label:'test',
  15. value:'http://pic.soutu123.com/back_pic/18/09/18/0ca02eb9c35f095481196354a1f455c8.jpg!/fw/700/quality/90/unsharp/true/compress/true',
  16. }],
  17. img2:['http://pic.soutu123.com/back_pic/18/07/06/514e96eedb99a663e02ab32614713243.jpg!/fw/700/quality/90/unsharp/true/compress/true','http://pic.soutu123.com/back_pic/18/09/18/0ca02eb9c35f095481196354a1f455c8.jpg!/fw/700/quality/90/unsharp/true/compress/true']
  18. }
  19. ],
  20. option:{
  21. page:false,
  22. align:'center',
  23. index:true,
  24. menuAlign:'center',
  25. column:[
  26. {
  27. label:'图片',
  28. prop:'img',
  29. type:'upload',
  30. imgWidth:100,
  31. listType:'picture-img'
  32. },{
  33. label:'JSON图片',
  34. prop:'img1',
  35. type:'upload',
  36. imgFullscreen:true,
  37. imgType:'card',
  38. listType:'picture-card',
  39. span:24,
  40. },{
  41. label:'Array图片',
  42. prop:'img2',
  43. type:'upload',
  44. dataType:'array',
  45. listType:'picture-card',
  46. span:24,
  47. }
  48. ]
  49. }
  50. };
  51. }
  52. }
  53. </script>

Avue-upload Option Attributes

参数说明类型可选值默认值
imgWidth图片的宽度(listType = picture-img)String / Number--
imgHeight图片的高度 (listType = picture-img)String / Number--
imgFullscreen是否全屏展示 (listType != picture-img)Booleantrue / falsefalse
imgType多图展示类型 (listType != picture-img)Stringbox / cardbox