@wyfex/ivue 0.20.0 → 0.21.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.
- package/dist/index.es.js +10 -10
- package/dist/index.umd.cjs +10 -10
- package/dist/ivue.css +1 -1
- package/dist/types/UseCrud/types.d.ts +0 -1
- package/dist/types/UseEcharts/hook.d.ts +6 -0
- package/dist/types/UseEcharts/index.vue.d.ts +105 -0
- package/dist/types/UseEcharts/props.d.ts +46 -0
- package/dist/types/UseEcharts/types.d.ts +6 -0
- package/dist/types/UseElButton/index.vue.d.ts +16 -5
- package/dist/types/UseElButton/props.d.ts +2 -2
- package/dist/types/UseElCheckbox/hook.d.ts +3 -2
- package/dist/types/UseElCheckbox/index.vue.d.ts +14 -8
- package/dist/types/UseElCheckbox/props.d.ts +6 -2
- package/dist/types/UseElCheckbox/types.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +8 -8
- package/src/components/UseCrud/types.ts +1 -3
- package/src/components/UseEcharts/props.ts +77 -0
- package/src/components/UseEcharts/types.ts +14 -0
- package/src/components/UseElButton/props.ts +3 -3
- package/src/components/UseElCheckbox/props.ts +7 -5
- package/src/components/UseElCheckbox/types.ts +4 -1
- package/src/components/UseLineTitle/defaultExtConfig.ts +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
echarts: {
|
|
3
|
+
type: import('vue').PropType<{
|
|
4
|
+
init: (...args: any[]) => any;
|
|
5
|
+
}>;
|
|
6
|
+
default: null;
|
|
7
|
+
};
|
|
8
|
+
options: {
|
|
9
|
+
type: import('vue').PropType<Record<string, any>>;
|
|
10
|
+
default: () => {};
|
|
11
|
+
};
|
|
12
|
+
width: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
height: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
theme: {
|
|
21
|
+
type: import('vue').PropType<string | Record<string, any>>;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
notMerge: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
resizeDelay: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
autoResize: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
loading: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
loadingConfig: {
|
|
41
|
+
type: import('vue').PropType<Record<string, any>>;
|
|
42
|
+
default: () => {};
|
|
43
|
+
};
|
|
44
|
+
}>, {
|
|
45
|
+
chartInstance: any;
|
|
46
|
+
initChart: () => void;
|
|
47
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
48
|
+
echarts: {
|
|
49
|
+
type: import('vue').PropType<{
|
|
50
|
+
init: (...args: any[]) => any;
|
|
51
|
+
}>;
|
|
52
|
+
default: null;
|
|
53
|
+
};
|
|
54
|
+
options: {
|
|
55
|
+
type: import('vue').PropType<Record<string, any>>;
|
|
56
|
+
default: () => {};
|
|
57
|
+
};
|
|
58
|
+
width: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
height: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
theme: {
|
|
67
|
+
type: import('vue').PropType<string | Record<string, any>>;
|
|
68
|
+
default: string;
|
|
69
|
+
};
|
|
70
|
+
notMerge: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: boolean;
|
|
73
|
+
};
|
|
74
|
+
resizeDelay: {
|
|
75
|
+
type: NumberConstructor;
|
|
76
|
+
default: number;
|
|
77
|
+
};
|
|
78
|
+
autoResize: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
82
|
+
loading: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
86
|
+
loadingConfig: {
|
|
87
|
+
type: import('vue').PropType<Record<string, any>>;
|
|
88
|
+
default: () => {};
|
|
89
|
+
};
|
|
90
|
+
}>> & Readonly<{}>, {
|
|
91
|
+
width: string;
|
|
92
|
+
options: Record<string, any>;
|
|
93
|
+
height: string;
|
|
94
|
+
echarts: {
|
|
95
|
+
init: (...args: any[]) => any;
|
|
96
|
+
};
|
|
97
|
+
theme: string | Record<string, any>;
|
|
98
|
+
notMerge: boolean;
|
|
99
|
+
resizeDelay: number;
|
|
100
|
+
autoResize: boolean;
|
|
101
|
+
loading: boolean;
|
|
102
|
+
loadingConfig: Record<string, any>;
|
|
103
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
104
|
+
declare const _default: typeof __VLS_export;
|
|
105
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
echarts: {
|
|
4
|
+
type: PropType<{
|
|
5
|
+
init: (...args: any[]) => any;
|
|
6
|
+
}>;
|
|
7
|
+
default: null;
|
|
8
|
+
};
|
|
9
|
+
options: {
|
|
10
|
+
type: PropType<Record<string, any>>;
|
|
11
|
+
default: () => {};
|
|
12
|
+
};
|
|
13
|
+
width: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
height: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
theme: {
|
|
22
|
+
type: PropType<string | Record<string, any>>;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
notMerge: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
resizeDelay: {
|
|
30
|
+
type: NumberConstructor;
|
|
31
|
+
default: number;
|
|
32
|
+
};
|
|
33
|
+
autoResize: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
loading: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
default: boolean;
|
|
40
|
+
};
|
|
41
|
+
loadingConfig: {
|
|
42
|
+
type: PropType<Record<string, any>>;
|
|
43
|
+
default: () => {};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export default _default;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare var __VLS_10: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_10) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
6
|
btnText: {
|
|
3
|
-
type: StringConstructor;
|
|
4
|
-
|
|
7
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
8
|
+
default: string;
|
|
5
9
|
};
|
|
6
10
|
type: {
|
|
7
11
|
type: StringConstructor;
|
|
@@ -16,8 +20,8 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
|
|
|
16
20
|
click: (value?: string | number | Record<string, unknown> | undefined) => any;
|
|
17
21
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
18
22
|
btnText: {
|
|
19
|
-
type: StringConstructor;
|
|
20
|
-
|
|
23
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
24
|
+
default: string;
|
|
21
25
|
};
|
|
22
26
|
type: {
|
|
23
27
|
type: StringConstructor;
|
|
@@ -33,6 +37,13 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
|
|
|
33
37
|
}>, {
|
|
34
38
|
type: string;
|
|
35
39
|
extConfig: import('./types').ExtConfig;
|
|
40
|
+
btnText: string | number | boolean;
|
|
36
41
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
42
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
43
|
declare const _default: typeof __VLS_export;
|
|
38
44
|
export default _default;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -2,8 +2,8 @@ import { PropType } from 'vue';
|
|
|
2
2
|
import { ExtConfig } from './types';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
btnText: {
|
|
5
|
-
type: StringConstructor;
|
|
6
|
-
|
|
5
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
6
|
+
default: string;
|
|
7
7
|
};
|
|
8
8
|
type: {
|
|
9
9
|
type: StringConstructor;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Emits, Props } from './types';
|
|
2
2
|
export declare const useElCheckbox: (props: Props, emits: Emits) => {
|
|
3
|
-
dataComputed: import('vue').ComputedRef<any>;
|
|
4
|
-
checkedItems: import('vue').WritableComputedRef<unknown[], any>;
|
|
3
|
+
dataComputed: import('vue').ComputedRef<Record<string, any>[] | null>;
|
|
4
|
+
checkedItems: import('vue').WritableComputedRef<unknown[] | undefined, any>;
|
|
5
5
|
isIndeterminate: import('vue').Ref<boolean, boolean>;
|
|
6
6
|
checkAll: import('vue').Ref<boolean, boolean>;
|
|
7
|
+
handleModelValueChange: (e: string | number | boolean) => void;
|
|
7
8
|
handleCheckAllChange: (bool: boolean) => void;
|
|
8
9
|
handleCheckedItemsChange: (list: any[]) => void;
|
|
9
10
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
2
|
modelValue: {
|
|
3
|
-
type: (ArrayConstructor | StringConstructor)[];
|
|
3
|
+
type: (ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
4
4
|
default: () => never[];
|
|
5
5
|
};
|
|
6
|
-
data:
|
|
6
|
+
data: {
|
|
7
|
+
type: import('vue').PropType<Record<string, any>[] | string[] | number[]>;
|
|
8
|
+
default: undefined;
|
|
9
|
+
};
|
|
7
10
|
defaultProps: {
|
|
8
11
|
type: ObjectConstructor;
|
|
9
12
|
default: () => {
|
|
@@ -24,13 +27,16 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
|
|
|
24
27
|
default: boolean;
|
|
25
28
|
};
|
|
26
29
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
27
|
-
"update:modelValue": (value: string | number | (string | number)[]) => any;
|
|
30
|
+
"update:modelValue": (value: string | number | boolean | (string | number)[]) => any;
|
|
28
31
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
29
32
|
modelValue: {
|
|
30
|
-
type: (ArrayConstructor | StringConstructor)[];
|
|
33
|
+
type: (ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
31
34
|
default: () => never[];
|
|
32
35
|
};
|
|
33
|
-
data:
|
|
36
|
+
data: {
|
|
37
|
+
type: import('vue').PropType<Record<string, any>[] | string[] | number[]>;
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
34
40
|
defaultProps: {
|
|
35
41
|
type: ObjectConstructor;
|
|
36
42
|
default: () => {
|
|
@@ -51,11 +57,11 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
|
|
|
51
57
|
default: boolean;
|
|
52
58
|
};
|
|
53
59
|
}>> & Readonly<{
|
|
54
|
-
"onUpdate:modelValue"?: ((value: string | number | (string | number)[]) => any) | undefined;
|
|
60
|
+
"onUpdate:modelValue"?: ((value: string | number | boolean | (string | number)[]) => any) | undefined;
|
|
55
61
|
}>, {
|
|
56
|
-
data: any;
|
|
62
|
+
data: Record<string, any>[] | string[] | number[];
|
|
57
63
|
toJoin: boolean;
|
|
58
|
-
modelValue: string | unknown[];
|
|
64
|
+
modelValue: string | number | boolean | unknown[];
|
|
59
65
|
defaultProps: Record<string, any>;
|
|
60
66
|
showCheckAll: boolean;
|
|
61
67
|
vertical: boolean;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
modelValue: {
|
|
3
|
-
type: (ArrayConstructor | StringConstructor)[];
|
|
4
|
+
type: (ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
4
5
|
default: () => never[];
|
|
5
6
|
};
|
|
6
|
-
data:
|
|
7
|
+
data: {
|
|
8
|
+
type: PropType<Record<string, any>[] | string[] | number[]>;
|
|
9
|
+
default: undefined;
|
|
10
|
+
};
|
|
7
11
|
defaultProps: {
|
|
8
12
|
type: ObjectConstructor;
|
|
9
13
|
default: () => {
|
|
@@ -2,5 +2,5 @@ import { ExtractPropTypes } from 'vue';
|
|
|
2
2
|
import { default as componentProps } from './props';
|
|
3
3
|
export type Props = ExtractPropTypes<typeof componentProps>;
|
|
4
4
|
export type Emits = {
|
|
5
|
-
(e: 'update:modelValue', value: string | number | (string | number)[]): void;
|
|
5
|
+
(e: 'update:modelValue', value: string | number | boolean | (string | number)[]): void;
|
|
6
6
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as UseCrud } from './UseCrud/index.vue';
|
|
2
|
+
export { default as UseEcharts } from './UseEcharts/index.vue';
|
|
2
3
|
export { default as UseElButton } from './UseElButton/index.vue';
|
|
3
4
|
export { default as UseElCheckbox } from './UseElCheckbox/index.vue';
|
|
4
5
|
export { default as UseElConfigProvider } from './UseElConfigProvider/index.vue';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wyfex/ivue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "万有前端 X 体系下基于 Vite8 + Vue3 + Typescript6 + ElementPlus2 构建的高性能组件库",
|
|
5
5
|
"homepage": "https://wyfex.top/idocs/ivue",
|
|
6
6
|
"type": "module",
|
|
@@ -50,20 +50,20 @@
|
|
|
50
50
|
"vue": ">=3.2.0 <4.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@types/node": "^26.
|
|
53
|
+
"@types/node": "^26.3.0",
|
|
54
54
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
55
55
|
"@vue/tsconfig": "^0.9.1",
|
|
56
|
-
"@wyfex/iutils": "^0.
|
|
57
|
-
"dayjs": "^1.11.
|
|
58
|
-
"element-plus": "^2.14.
|
|
59
|
-
"sass-embedded": "^1.
|
|
56
|
+
"@wyfex/iutils": "^0.80.0",
|
|
57
|
+
"dayjs": "^1.11.23",
|
|
58
|
+
"element-plus": "^2.14.5",
|
|
59
|
+
"sass-embedded": "^1.103.1",
|
|
60
60
|
"typescript": "~6.0.3",
|
|
61
61
|
"unplugin-auto-import": "^21.1.0",
|
|
62
62
|
"unplugin-dts": "^1.0.3",
|
|
63
63
|
"unplugin-vue-components": "^32.1.0",
|
|
64
|
-
"vite": "^8.2.
|
|
64
|
+
"vite": "^8.2.2",
|
|
65
65
|
"vite-svg-loader": "^5.1.1",
|
|
66
66
|
"vue": "^3.5.41",
|
|
67
|
-
"vue-tsc": "^3.3.
|
|
67
|
+
"vue-tsc": "^3.3.11"
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -114,10 +114,8 @@ export interface UseCrudState {
|
|
|
114
114
|
formColumns: FormColumn[]
|
|
115
115
|
/** 表格列配置 */
|
|
116
116
|
tableColumns: TableColumn[]
|
|
117
|
-
/** 表单模型
|
|
117
|
+
/** 表单模型 */
|
|
118
118
|
formModel: Record<string, any>
|
|
119
|
-
/** 表单参数 查询表单提交接口的数据参数 */
|
|
120
|
-
formParams: Record<string, any>
|
|
121
119
|
/** 表格loading */
|
|
122
120
|
tableLoading: boolean
|
|
123
121
|
/** 表格数据 */
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { PropType } from 'vue'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 组件props
|
|
5
|
+
*/
|
|
6
|
+
export default {
|
|
7
|
+
/**
|
|
8
|
+
* Echarts实例(即import * as echarts from 'echarts') 可通过provide传入
|
|
9
|
+
*/
|
|
10
|
+
echarts: {
|
|
11
|
+
type: Object as PropType<{ init: (...args: any[]) => any }>,
|
|
12
|
+
default: null
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* 配置项
|
|
16
|
+
*/
|
|
17
|
+
options: {
|
|
18
|
+
type: Object as PropType<Record<string, any>>,
|
|
19
|
+
default: () => ({})
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* 容器宽度
|
|
23
|
+
*/
|
|
24
|
+
width: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: '100%'
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* 容器高度
|
|
30
|
+
*/
|
|
31
|
+
height: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: '100%'
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* 主题
|
|
37
|
+
*/
|
|
38
|
+
theme: {
|
|
39
|
+
type: [String, Object] as PropType<string | Record<string, any>>,
|
|
40
|
+
default: ''
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* 是否不和options合并
|
|
44
|
+
*/
|
|
45
|
+
notMerge: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* resize 防抖毫秒
|
|
51
|
+
*/
|
|
52
|
+
resizeDelay: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: 100
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* 是否开启窗口自动resize
|
|
58
|
+
*/
|
|
59
|
+
autoResize: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* 是否显示loading加载动画
|
|
65
|
+
*/
|
|
66
|
+
loading: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* loading自定义样式配置,对应echarts showLoading参数
|
|
72
|
+
*/
|
|
73
|
+
loadingConfig: {
|
|
74
|
+
type: Object as PropType<Record<string, any>>,
|
|
75
|
+
default: () => ({})
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import componentProps from './props'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* props类型
|
|
6
|
+
*/
|
|
7
|
+
export type Props = ExtractPropTypes<typeof componentProps>
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* inject的echarts类型
|
|
11
|
+
*/
|
|
12
|
+
export type InjectedEcharts = {
|
|
13
|
+
init: (dom: HTMLElement | null, theme?: string | object) => any
|
|
14
|
+
}
|
|
@@ -6,11 +6,11 @@ import type { ExtConfig } from './types'
|
|
|
6
6
|
*/
|
|
7
7
|
export default {
|
|
8
8
|
/**
|
|
9
|
-
* 按钮文本
|
|
9
|
+
* 按钮文本 未传时可使用自定义slot
|
|
10
10
|
*/
|
|
11
11
|
btnText: {
|
|
12
|
-
type: String,
|
|
13
|
-
|
|
12
|
+
type: [String, Number, Boolean],
|
|
13
|
+
default: ''
|
|
14
14
|
},
|
|
15
15
|
/**
|
|
16
16
|
* 按钮类型 同ElButton类型,默认为primary
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { PropType } from 'vue'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* 组件props
|
|
3
5
|
*/
|
|
@@ -6,16 +8,16 @@ export default {
|
|
|
6
8
|
* 双向绑定数据源
|
|
7
9
|
*/
|
|
8
10
|
modelValue: {
|
|
9
|
-
type: [Array, String],
|
|
11
|
+
type: [Array, String, Number, Boolean],
|
|
10
12
|
default: () => []
|
|
11
13
|
},
|
|
12
14
|
/**
|
|
13
|
-
* 选项数据源
|
|
15
|
+
* 选项数据源 如不传则默认为单个复选框
|
|
14
16
|
*/
|
|
15
17
|
data: {
|
|
16
|
-
type: Array,
|
|
17
|
-
|
|
18
|
-
}
|
|
18
|
+
type: Array as PropType<Record<string, any>[] | string[] | number[]>,
|
|
19
|
+
default: undefined
|
|
20
|
+
},
|
|
19
21
|
/**
|
|
20
22
|
* 选项默认配置
|
|
21
23
|
*/
|
|
@@ -11,5 +11,8 @@ export type Props = ExtractPropTypes<typeof componentProps>
|
|
|
11
11
|
*/
|
|
12
12
|
export type Emits = {
|
|
13
13
|
/** 更新value值 */
|
|
14
|
-
(
|
|
14
|
+
(
|
|
15
|
+
e: 'update:modelValue',
|
|
16
|
+
value: string | number | boolean | (string | number)[]
|
|
17
|
+
): void
|
|
15
18
|
}
|