大表哥(宇宙最强表格)

TIP

1.0.9+

  • 复杂表头
  • 表格树
  • 自带分页信息
  • 自带增删改查
  • 自定义弹出表单
  • 支持crud组件全部功能
  • 支持form组件全部功能

普通用法

大表哥(宇宙最强表格) - 图1

  1. <avue-crud :option="option" :data="data" :page="page" @on-load="onLoad"></avue-crud>
  2. <script>
  3. export default {
  4. data() {
  5. return {
  6. page: {
  7. pageSize: 20
  8. },
  9. option: {
  10. border: true,
  11. index: true,
  12. expandLevel: 3,
  13. headerAlign: 'center',
  14. align: 'center',
  15. tree: true,
  16. labelWidth: 100,
  17. column: [{
  18. width:130,
  19. label: '姓名',
  20. prop: 'name',
  21. }, {
  22. label: '性别1',
  23. prop: 'sex',
  24. },
  25. {
  26. label: '自定义图标',
  27. prop: 'icon',
  28. type: "icon-select",
  29. iconList: [{
  30. label: '基本图表',
  31. list: ['el-icon-time', 'el-icon-bell', 'el-icon-star-on']
  32. }]
  33. }, {
  34. label: '复杂表头',
  35. children: [{
  36. label: '信息',
  37. children: [{
  38. label: '年龄',
  39. prop: 'age'
  40. }, {
  41. label: '手机号',
  42. prop: 'phone',
  43. }]
  44. }, {
  45. label: '级别',
  46. prop: 'grade',
  47. type: 'select',
  48. dicData: [{
  49. label: '测试',
  50. value: 1
  51. }]
  52. }]
  53. }, {
  54. label: '测试',
  55. prop: 'test',
  56. }],
  57. group: [{
  58. label: '用户信息',
  59. prop: 'jbxx',
  60. icon: 'el-icon-edit-outline',
  61. column: [
  62. {
  63. label: '姓名',
  64. prop: 'name'
  65. },
  66. {
  67. label: '年龄',
  68. prop: 'age'
  69. }
  70. ]
  71. }, {
  72. label: '其他信息',
  73. prop: 'jbxxs',
  74. icon: 'el-icon-edit-outline',
  75. column: [
  76. {
  77. label: '级别',
  78. prop: 'grade',
  79. type: 'select',
  80. dicData: [{
  81. label: '测试',
  82. value: 1
  83. }]
  84. },
  85. {
  86. label: '手机信息',
  87. prop: 'phone'
  88. },
  89. {
  90. label: '自定义图标',
  91. prop: 'icon',
  92. type: "icon-select",
  93. iconList: [{
  94. label: '基本图表',
  95. list: ['el-icon-time', 'el-icon-bell', 'el-icon-star-on']
  96. }]
  97. },
  98. ]
  99. }]
  100. },
  101. data: [{
  102. id:'1',
  103. name: '张三',
  104. age: 14,
  105. grade: 1,
  106. phone1: '17547400800',
  107. phone: '17547400800',
  108. icon: 'el-icon-time',
  109. test: 1,
  110. sex: '男',
  111. children: [{
  112. id:'2',
  113. name: '李四',
  114. age: 20,
  115. grade: 1,
  116. sex: '男',
  117. test: 1,
  118. phone1: '17547400800',
  119. phone: '17547400800',
  120. icon: 'el-icon-bell',
  121. children: [{
  122. id:'3',
  123. name: '王五',
  124. age: 10,
  125. grade: 1,
  126. test: 1,
  127. sex: '女',
  128. icon: 'el-icon-star-on',
  129. phone1: '17547400800',
  130. phone: '17547400800'
  131. }]
  132. }]
  133. }, {
  134. id:'4',
  135. name: '王五',
  136. age: 10,
  137. grade: 1,
  138. test: 1,
  139. sex: '女',
  140. icon: 'el-icon-star-on',
  141. phone1: '17547400800',
  142. phone: '17547400800'
  143. }]
  144. }
  145. },
  146. methods: {
  147. onLoad(page) {
  148. //模拟分页
  149. this.page.total = 40
  150. }
  151. }
  152. }
  153. </script>