@elementplus-kit/uikit 1.11.0 → 1.12.0

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.
@@ -102,12 +102,16 @@ export default defineComponent({
102
102
  const defaultAttrs = {
103
103
  splitButton: true,
104
104
  };
105
+ // 禁用时有下拉不禁用
106
+ // if(item.disabled && dropdownItemList.length > 0) {
107
+ // defaultAttrs.class = `is-disabled-down ${item.class}`
108
+ // }
105
109
  // 过滤下拉菜单属性
106
110
  const l = [
107
111
  "type",
108
112
  "size",
109
113
  "splitButton",
110
- "disabled",
114
+ // "disabled",
111
115
  "placement",
112
116
  "effect",
113
117
  "trigger",
@@ -218,29 +222,19 @@ export default defineComponent({
218
222
  {
219
223
  ...getDropdownAttrs(dropdownMain[0]),
220
224
  class: "c-btn-dropdown",
221
- buttonProps: getAttrs(dropdownMain[0]),
222
- splitButton: true,
223
- // splitButton: dropdownItemList.length > 0,
224
- onClick: () => {
225
- emit("btnAction", dropdownMain[0].alias, props.params);
226
- },
227
- onCommand: (command: string) => {
228
- emit("btnAction", command, props.params);
229
- },
225
+ popperClass: "c-btn-dropdown-popper",
230
226
  },
231
227
  {
232
- default: () => {
233
- return dropdownMain[0].label;
234
- },
228
+ default: () => createBtn(dropdownMain[0]),
235
229
  dropdown: () => {
236
230
  return dropdownItemList.map((item) => {
237
231
  return h(
238
232
  ElDropdownItem,
239
233
  {
240
- command: item.alias,
234
+ // command: item.alias,
241
235
  },
242
236
  {
243
- default: () => item?.label,
237
+ default: () => createBtn(item),
244
238
  },
245
239
  );
246
240
  });
@@ -264,14 +258,25 @@ export default defineComponent({
264
258
  } else if (isString(props.fold)) {
265
259
  isFold = true;
266
260
  }
267
- if (isFold) {
268
- return createDropdown(finalList);
269
- } else {
270
- // 不折叠
271
- return finalList.map((item) => {
272
- return createBtn(item);
273
- });
274
- }
261
+
262
+ return h(
263
+ "div",
264
+ {
265
+ class: "c-button",
266
+ },
267
+ {
268
+ default: () => {
269
+ if (isFold) {
270
+ return createDropdown(finalList);
271
+ } else {
272
+ // 不折叠
273
+ return finalList.map((item) => {
274
+ return createBtn(item);
275
+ });
276
+ }
277
+ },
278
+ },
279
+ );
275
280
  };
276
281
  return () => render();
277
282
  },
@@ -1,3 +1,44 @@
1
- .el-button + .el-dropdown {
2
- margin-left: 10px;
1
+ .c-button {
2
+ display: inline-block;
3
+ .el-button + .el-dropdown {
4
+ margin-left: 10px;
5
+ }
6
+ > .el-button + .el-button {
7
+ margin-left: 10px;
8
+ }
9
+ .c-btn-dropdown {
10
+ .el-button-group {
11
+ > .el-button:nth-child(1) {
12
+ // 格式第一个按钮
13
+ padding: 0;
14
+ border: none;
15
+ background-color: transparent;
16
+ .el-button {
17
+ border-bottom-right-radius: 0;
18
+ border-top-right-radius: 0;
19
+ }
20
+ }
21
+ }
22
+ // 按钮聚焦外轮廓阴影
23
+ .el-button:focus-visible {
24
+ outline: none;
25
+ }
26
+ }
27
+ }
28
+ // 下拉悬浮窗
29
+ .c-btn-dropdown-popper {
30
+ .el-dropdown-menu__item {
31
+ padding: 0;
32
+ }
33
+ .el-button {
34
+ width: 100%;
35
+ border: none;
36
+ border-radius: 0;
37
+ }
38
+ .el-dropdown-menu__item + .el-dropdown-menu__item {
39
+ margin-top: 1px;
40
+ }
41
+ }
42
+ .c-btn-dropdown-popper.is-light {
43
+ border: none;
3
44
  }
@@ -15,10 +15,6 @@ import {
15
15
  } from "./constants.ts";
16
16
  import { isArray, isObject, isFunction } from "lodash-es";
17
17
  const tableAttrs = {
18
- module: {
19
- type: Object,
20
- default: () => {},
21
- },
22
18
  params: {
23
19
  // 额外业务全局参数
24
20
  type: Object,
@@ -12,6 +12,8 @@ export type TableProps = Expand<Partial<TableAttrs>> &
12
12
 
13
13
  // 表格项属性
14
14
  export type TableColumnProps = {
15
+ label: string;
16
+ prop?: string | undefined;
15
17
  vIf?: (params: any) => boolean;
16
18
  render?: (scope: any) => any;
17
19
  options?: Array<{ label: string; value: any }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementplus-kit/uikit",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "",
5
5
  "main": "./components/index.ts",
6
6
  "peerDependencies": {