br-dionysus 0.7.11 → 0.7.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -176,7 +176,7 @@ const optionsMap = computed(() => {
176
176
 
177
177
  // 分页
178
178
  const page = reactive<Page>(new Page({
179
- total: props.total,
179
+ total: props.total as number,
180
180
  pageSize: 5,
181
181
  currentPage: 1,
182
182
  pageSizesOptions: [5, 10, 20]
@@ -13,12 +13,10 @@ import demo from './demo.vue'
13
13
 
14
14
 
15
15
  ### 2) Attributes
16
- | 参数 | 说明 | 类型 | 可选值 | 默认值 |
17
- | ------------------| --------------------------|-------------------|------------------------|---------|
18
- |filtersValue | 列筛选过滤条件 | object | - | { } |
19
- |filters | 表格筛选数据 | string[],number[] | - | any[] |
20
- |filterMethod | 筛选方法 | Function | - | () => void |
21
- |其余参数 | 参考el官网的table | any | - |https://element-plus.org/zh-CN/component/table.html|
22
-
23
-
24
-
16
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
17
+ | ------------ | ----------------------------------- | ------------------ | ------ | --------------------------------------------------- |
18
+ | filtersValue | 列筛选过滤条件 | object | - | { } |
19
+ | filters | 表格筛选数据 | string[],number[] | - | any[] |
20
+ | filterMethod | 筛选方法 | Function | - | () => void |
21
+ | children | 多级表头 时使用传递对应数据进行循环 | Table-column API[] | - | [] |
22
+ | 其余参数 | 参考el官网的table | any | - | https://element-plus.org/zh-CN/component/table.html |
@@ -9,7 +9,9 @@
9
9
  :minWidth="item.minWidth"
10
10
  v-model:filtersValue="filtersValue"
11
11
  showOverflowTooltip
12
- />
12
+ :children="item.children||[]"
13
+ >
14
+ </MTableColumn>
13
15
  </el-table>
14
16
  </div>
15
17
  </template>
@@ -26,7 +28,7 @@ interface User {
26
28
  address: string;
27
29
  tag: string;
28
30
  }
29
- const tableData = ref(<User[]>[
31
+ const tableData = ref<User[]>([
30
32
  {
31
33
  date: "2016-05-03",
32
34
  name: "Tom",
@@ -65,8 +67,30 @@ const tableTitle = [
65
67
  },
66
68
  {
67
69
  label: '地址',
68
- prop: 'address',
69
- minWidth: '134px'
70
+ children: [
71
+ {
72
+ label: '123', children: [
73
+ {
74
+ label: '222222222222',
75
+ prop: 'address',
76
+ minWidth: '134px'
77
+
78
+ },
79
+ {
80
+ label: 'qqqqqq',
81
+ prop: 'address',
82
+ minWidth: '134px'
83
+
84
+ }
85
+ ]
86
+ },
87
+ {
88
+ label: '2222',
89
+ prop: 'address',
90
+ minWidth: '134px'
91
+ },
92
+ ]
93
+
70
94
  },
71
95
  {
72
96
  label: '标签',
@@ -11,6 +11,17 @@
11
11
  :index="scope.$index"
12
12
  ></slot>
13
13
  </template>
14
+ <template v-if="props.children && props.children.length">
15
+ <index
16
+ v-for="child in props.children"
17
+ :key="child.prop"
18
+ :prop="child.prop"
19
+ :label="child.label"
20
+ :minWidth="child.minWidth"
21
+ showOverflowTooltip
22
+ :children="child.children || []"
23
+ ></index>
24
+ </template>
14
25
  <template #header="scope">
15
26
  <span>
16
27
  <slot
@@ -95,14 +106,21 @@ interface FilterValue {
95
106
  [key: string]: Array<string | number>
96
107
  }
97
108
 
109
+ interface PropChildren {
110
+ [prop: string]: any,
111
+ children?: PropChildren[]
112
+ }
113
+
98
114
  const props = withDefaults(defineProps<{
99
115
  filtersValue?: FilterValue,
100
116
  filters?: Array<{ text: string | number, value: string | number }>,
101
- filterMethod?: Function
117
+ filterMethod?: Function,
118
+ children?: Array<PropChildren>
102
119
  }>(), {
103
120
  filtersValue: () => ({}),
104
121
  filters: () => [],
105
- filterMethod: () => {}
122
+ filterMethod: () => {},
123
+ children: () => []
106
124
  })
107
125
 
108
126
  const slots = useSlots()