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.
- package/README.md +36 -14
- package/dist/br-dionysus.es.js +606 -595
- package/dist/br-dionysus.umd.js +3 -3
- package/dist/index.css +1 -1
- package/dist/packages/MSelectTable/src/index.vue.d.ts +1 -1
- package/dist/packages/MTableColumn/src/index.vue.d.ts +9 -0
- package/package.json +1 -1
- package/packages/MSelectTable/docs/demo.vue +1 -1
- package/packages/MSelectTable/src/index.vue +1 -1
- package/packages/MTableColumn/docs/README.md +7 -9
- package/packages/MTableColumn/docs/demo.vue +28 -4
- package/packages/MTableColumn/src/index.vue +20 -2
|
@@ -13,12 +13,10 @@ import demo from './demo.vue'
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
### 2) Attributes
|
|
16
|
-
| 参数
|
|
17
|
-
|
|
|
18
|
-
|filtersValue
|
|
19
|
-
|filters
|
|
20
|
-
|filterMethod
|
|
21
|
-
|
|
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
|
|
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
|
-
|
|
69
|
-
|
|
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()
|