index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class="">
  3. <toolbar @onSearch="filterData" />
  4. <div class="m-10 bg-w p-20 br-10">
  5. <el-button type="primary" icon="el-icon-plus" @click="handleSubmit"
  6. >新增</el-button
  7. >
  8. <base-table
  9. :columns="columns"
  10. :items="items"
  11. :pagination="pagination"
  12. :page-change="pageChange"
  13. />
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import toolbar from './toolbar';
  19. import mxFilterList from '@/mixins/filterList';
  20. export default {
  21. name: 'RoleManagement',
  22. components: { toolbar },
  23. mixins: [
  24. mxFilterList({
  25. // fetchList: iGetList // 在下方data再声明一个 fetchList: iGetList 同等效果
  26. })
  27. ],
  28. data() {
  29. return {
  30. columns: [
  31. {
  32. key: 'id',
  33. name: 'ID',
  34. width: '60'
  35. },
  36. {
  37. key: 'photo',
  38. name: '图片',
  39. width: '240'
  40. },
  41. {
  42. key: 'region',
  43. name: '位置',
  44. minWidth: '120'
  45. },
  46. {
  47. key: 'region',
  48. name: '标题',
  49. minWidth: '180'
  50. },
  51. {
  52. key: 'region',
  53. name: '链接',
  54. minWidth: '240',
  55. showOverflowTooltip: true
  56. },
  57. {
  58. key: 'region',
  59. name: '排序',
  60. width: '60'
  61. },
  62. {
  63. key: 'region',
  64. name: '状态',
  65. width: '80'
  66. },
  67. {
  68. key: 'action',
  69. name: '操作',
  70. width: '120'
  71. }
  72. ]
  73. };
  74. }
  75. };
  76. </script>
  77. <style type="scss" scoped></style>