straw-ui-vue 0.1.19 → 0.1.21
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 +146 -147
- package/dist/{cn-CiflBmGp.js → cn-CThBjlvA.js} +7 -7
- package/dist/components/st-button/types.d.ts +63 -63
- package/dist/components/st-card/types.d.ts +184 -184
- package/dist/components/st-cascade/types.d.ts +156 -156
- package/dist/components/st-checkbox/types.d.ts +120 -120
- package/dist/components/st-color-picker/types.d.ts +160 -160
- package/dist/components/st-date-picker/types.d.ts +157 -157
- package/dist/components/st-datetime-picker/types.d.ts +155 -155
- package/dist/components/st-dialog/types.d.ts +293 -293
- package/dist/components/st-divider/types.d.ts +92 -92
- package/dist/components/st-drawer/types.d.ts +232 -232
- package/dist/components/st-empty/types.d.ts +39 -39
- package/dist/components/st-form-control/types.d.ts +21 -21
- package/dist/components/st-form-description/types.d.ts +21 -21
- package/dist/components/st-form-field/types.d.ts +64 -64
- package/dist/components/st-form-item/types.d.ts +21 -21
- package/dist/components/st-form-label/types.d.ts +19 -19
- package/dist/components/st-form-message/types.d.ts +23 -23
- package/dist/components/st-image/types.d.ts +58 -58
- package/dist/components/st-input/types.d.ts +415 -415
- package/dist/components/st-label/types.d.ts +19 -19
- package/dist/components/st-menu/types.d.ts +262 -262
- package/dist/components/st-pagination/types.d.ts +91 -91
- package/dist/components/st-popover/types.d.ts +202 -202
- package/dist/components/st-progress/types.d.ts +37 -37
- package/dist/components/st-radio/types.d.ts +126 -126
- package/dist/components/st-scrollbar/types.d.ts +62 -62
- package/dist/components/st-segmented/types.d.ts +53 -53
- package/dist/components/st-select/types.d.ts +249 -249
- package/dist/components/st-sidebar/types.d.ts +85 -85
- package/dist/components/st-sidebar-item/types.d.ts +45 -45
- package/dist/components/st-skeleton/types.d.ts +56 -56
- package/dist/components/st-slider/types.d.ts +61 -61
- package/dist/components/st-splitter/types.d.ts +260 -260
- package/dist/components/st-splitter-panel/types.d.ts +63 -63
- package/dist/components/st-switch/types.d.ts +53 -53
- package/dist/components/st-tabs/types.d.ts +151 -151
- package/dist/components/st-tag/types.d.ts +51 -51
- package/dist/components/st-time-picker/types.d.ts +143 -143
- package/dist/components/st-toggle/types.d.ts +58 -58
- package/dist/components/st-tooltip/types.d.ts +172 -172
- package/dist/components/st-tree/types.d.ts +188 -188
- package/dist/straw-ui.js +344 -254
- package/package.json +16 -11
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 空状态组件属性
|
|
5
|
-
* */
|
|
6
|
-
export interface StEmptyProps {
|
|
7
|
-
/** 描述文字 */
|
|
8
|
-
description?: string;
|
|
9
|
-
/** 自定义图标名称 */
|
|
10
|
-
icon?: string;
|
|
11
|
-
/** 自定义图片地址 */
|
|
12
|
-
image?: string;
|
|
13
|
-
/** 图标类名 */
|
|
14
|
-
iconClass?: ClassValue;
|
|
15
|
-
/** 图标样式 */
|
|
16
|
-
iconStyle?: StyleValue;
|
|
17
|
-
/** 图片类名 */
|
|
18
|
-
imageClass?: ClassValue;
|
|
19
|
-
/** 图标样式 */
|
|
20
|
-
imageStyle?: StyleValue;
|
|
21
|
-
/** 描述文字类名 */
|
|
22
|
-
descriptionClass?: ClassValue;
|
|
23
|
-
/** 描述文本样式 */
|
|
24
|
-
descriptionStyle?: StyleValue;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 空状态组件插槽类型
|
|
29
|
-
* */
|
|
30
|
-
export interface StEmptySlots {
|
|
31
|
-
/** 默认插槽,自定义内容 */
|
|
32
|
-
default?: () => unknown;
|
|
33
|
-
/** 图标插槽 */
|
|
34
|
-
icon?: () => unknown;
|
|
35
|
-
/** 描述文字插槽 */
|
|
36
|
-
description?: () => unknown;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export {};
|
|
1
|
+
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 空状态组件属性
|
|
5
|
+
* */
|
|
6
|
+
export interface StEmptyProps {
|
|
7
|
+
/** 描述文字 */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** 自定义图标名称 */
|
|
10
|
+
icon?: string;
|
|
11
|
+
/** 自定义图片地址 */
|
|
12
|
+
image?: string;
|
|
13
|
+
/** 图标类名 */
|
|
14
|
+
iconClass?: ClassValue;
|
|
15
|
+
/** 图标样式 */
|
|
16
|
+
iconStyle?: StyleValue;
|
|
17
|
+
/** 图片类名 */
|
|
18
|
+
imageClass?: ClassValue;
|
|
19
|
+
/** 图标样式 */
|
|
20
|
+
imageStyle?: StyleValue;
|
|
21
|
+
/** 描述文字类名 */
|
|
22
|
+
descriptionClass?: ClassValue;
|
|
23
|
+
/** 描述文本样式 */
|
|
24
|
+
descriptionStyle?: StyleValue;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 空状态组件插槽类型
|
|
29
|
+
* */
|
|
30
|
+
export interface StEmptySlots {
|
|
31
|
+
/** 默认插槽,自定义内容 */
|
|
32
|
+
default?: () => unknown;
|
|
33
|
+
/** 图标插槽 */
|
|
34
|
+
icon?: () => unknown;
|
|
35
|
+
/** 描述文字插槽 */
|
|
36
|
+
description?: () => unknown;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 表单控制组件属性接口
|
|
5
|
-
* */
|
|
6
|
-
export interface StFormControlProps {
|
|
7
|
-
/** 自定义类名 */
|
|
8
|
-
class?: ClassValue;
|
|
9
|
-
/** 自定义样式 */
|
|
10
|
-
style?: StyleValue;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 表单控制组件插槽接口
|
|
15
|
-
* */
|
|
16
|
-
export interface StFormControlSlots {
|
|
17
|
-
/** 默认插槽,用于放置实际输入组件 */
|
|
18
|
-
default?: () => unknown;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export {};
|
|
1
|
+
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 表单控制组件属性接口
|
|
5
|
+
* */
|
|
6
|
+
export interface StFormControlProps {
|
|
7
|
+
/** 自定义类名 */
|
|
8
|
+
class?: ClassValue;
|
|
9
|
+
/** 自定义样式 */
|
|
10
|
+
style?: StyleValue;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 表单控制组件插槽接口
|
|
15
|
+
* */
|
|
16
|
+
export interface StFormControlSlots {
|
|
17
|
+
/** 默认插槽,用于放置实际输入组件 */
|
|
18
|
+
default?: () => unknown;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 表单描述组件属性
|
|
5
|
-
* */
|
|
6
|
-
export interface StFormDescriptionProps {
|
|
7
|
-
/** 自定义类名 */
|
|
8
|
-
class?: ClassValue;
|
|
9
|
-
/** 自定义样式 */
|
|
10
|
-
style?: StyleValue;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 表单描述组件插槽类型
|
|
15
|
-
* */
|
|
16
|
-
export interface StFormDescriptionSlots {
|
|
17
|
-
/** 默认插槽 */
|
|
18
|
-
default?: () => unknown;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export {};
|
|
1
|
+
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 表单描述组件属性
|
|
5
|
+
* */
|
|
6
|
+
export interface StFormDescriptionProps {
|
|
7
|
+
/** 自定义类名 */
|
|
8
|
+
class?: ClassValue;
|
|
9
|
+
/** 自定义样式 */
|
|
10
|
+
style?: StyleValue;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 表单描述组件插槽类型
|
|
15
|
+
* */
|
|
16
|
+
export interface StFormDescriptionSlots {
|
|
17
|
+
/** 默认插槽 */
|
|
18
|
+
default?: () => unknown;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {};
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 表单字段组件属性接口
|
|
5
|
-
* */
|
|
6
|
-
export interface StFormFieldProps {
|
|
7
|
-
/** 字段名称 */
|
|
8
|
-
name?: string;
|
|
9
|
-
/** 自定义类名 */
|
|
10
|
-
class?: ClassValue;
|
|
11
|
-
/** 自定义样式 */
|
|
12
|
-
style?: StyleValue;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 组件字段绑定接口
|
|
17
|
-
* 用于绑定到输入组件的属性和事件
|
|
18
|
-
* */
|
|
19
|
-
export interface StComponentField {
|
|
20
|
-
/** 绑定值 */
|
|
21
|
-
modelValue: unknown;
|
|
22
|
-
/** 更新绑定值事件 */
|
|
23
|
-
'onUpdate:modelValue': (value: unknown) => void;
|
|
24
|
-
/** 是否禁用 */
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
/** 是否有错误 */
|
|
27
|
-
error?: boolean;
|
|
28
|
-
/** 字段名称 */
|
|
29
|
-
name?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 表单字段上下文接口
|
|
34
|
-
* 通过 provide/inject 传递给子组件
|
|
35
|
-
* */
|
|
36
|
-
export interface StFormFieldContext {
|
|
37
|
-
/** 字段名称 */
|
|
38
|
-
name: string;
|
|
39
|
-
/** 当前值 */
|
|
40
|
-
modelValue: unknown;
|
|
41
|
-
/** 更新值的函数 */
|
|
42
|
-
updateValue: (value: unknown) => void;
|
|
43
|
-
/** 是否禁用 */
|
|
44
|
-
disabled: boolean;
|
|
45
|
-
/** 是否有错误 */
|
|
46
|
-
error: boolean;
|
|
47
|
-
/** 设置错误状态 */
|
|
48
|
-
setError: (error: boolean) => void;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 表单字段组件插槽接口
|
|
53
|
-
* */
|
|
54
|
-
export interface StFormFieldSlots {
|
|
55
|
-
/** 默认插槽 */
|
|
56
|
-
default?: (props: { componentField: StComponentField }) => unknown;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* 表单字段组件注入键类型
|
|
61
|
-
* */
|
|
62
|
-
export type StFormFieldInjectionKey = symbol;
|
|
63
|
-
|
|
64
|
-
export {};
|
|
1
|
+
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 表单字段组件属性接口
|
|
5
|
+
* */
|
|
6
|
+
export interface StFormFieldProps {
|
|
7
|
+
/** 字段名称 */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** 自定义类名 */
|
|
10
|
+
class?: ClassValue;
|
|
11
|
+
/** 自定义样式 */
|
|
12
|
+
style?: StyleValue;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 组件字段绑定接口
|
|
17
|
+
* 用于绑定到输入组件的属性和事件
|
|
18
|
+
* */
|
|
19
|
+
export interface StComponentField {
|
|
20
|
+
/** 绑定值 */
|
|
21
|
+
modelValue: unknown;
|
|
22
|
+
/** 更新绑定值事件 */
|
|
23
|
+
'onUpdate:modelValue': (value: unknown) => void;
|
|
24
|
+
/** 是否禁用 */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** 是否有错误 */
|
|
27
|
+
error?: boolean;
|
|
28
|
+
/** 字段名称 */
|
|
29
|
+
name?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 表单字段上下文接口
|
|
34
|
+
* 通过 provide/inject 传递给子组件
|
|
35
|
+
* */
|
|
36
|
+
export interface StFormFieldContext {
|
|
37
|
+
/** 字段名称 */
|
|
38
|
+
name: string;
|
|
39
|
+
/** 当前值 */
|
|
40
|
+
modelValue: unknown;
|
|
41
|
+
/** 更新值的函数 */
|
|
42
|
+
updateValue: (value: unknown) => void;
|
|
43
|
+
/** 是否禁用 */
|
|
44
|
+
disabled: boolean;
|
|
45
|
+
/** 是否有错误 */
|
|
46
|
+
error: boolean;
|
|
47
|
+
/** 设置错误状态 */
|
|
48
|
+
setError: (error: boolean) => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 表单字段组件插槽接口
|
|
53
|
+
* */
|
|
54
|
+
export interface StFormFieldSlots {
|
|
55
|
+
/** 默认插槽 */
|
|
56
|
+
default?: (props: { componentField: StComponentField }) => unknown;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 表单字段组件注入键类型
|
|
61
|
+
* */
|
|
62
|
+
export type StFormFieldInjectionKey = symbol;
|
|
63
|
+
|
|
64
|
+
export {};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 表单项组件属性
|
|
5
|
-
* */
|
|
6
|
-
export interface StFormItemProps {
|
|
7
|
-
/** 自定义类名 */
|
|
8
|
-
class?: ClassValue;
|
|
9
|
-
/** 自定义样式 */
|
|
10
|
-
style?: StyleValue;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 表单项组件插槽类型
|
|
15
|
-
* */
|
|
16
|
-
export interface StFormItemSlots {
|
|
17
|
-
/** 默认插槽 */
|
|
18
|
-
default?: () => unknown;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export {};
|
|
1
|
+
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 表单项组件属性
|
|
5
|
+
* */
|
|
6
|
+
export interface StFormItemProps {
|
|
7
|
+
/** 自定义类名 */
|
|
8
|
+
class?: ClassValue;
|
|
9
|
+
/** 自定义样式 */
|
|
10
|
+
style?: StyleValue;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 表单项组件插槽类型
|
|
15
|
+
* */
|
|
16
|
+
export interface StFormItemSlots {
|
|
17
|
+
/** 默认插槽 */
|
|
18
|
+
default?: () => unknown;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { StLabelProps } from '../st-label/types.d.ts';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 表单标签组件属性
|
|
5
|
-
* */
|
|
6
|
-
export interface StFormLabelProps extends /* @vue-ignore */ StLabelProps {
|
|
7
|
-
/** 是否显示错误状态 */
|
|
8
|
-
error?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 表单标签组件插槽类型
|
|
13
|
-
* */
|
|
14
|
-
export interface StFormLabelSlots {
|
|
15
|
-
/** 默认插槽 */
|
|
16
|
-
default?: () => unknown;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export {};
|
|
1
|
+
import type { StLabelProps } from '../st-label/types.d.ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 表单标签组件属性
|
|
5
|
+
* */
|
|
6
|
+
export interface StFormLabelProps extends /* @vue-ignore */ StLabelProps {
|
|
7
|
+
/** 是否显示错误状态 */
|
|
8
|
+
error?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 表单标签组件插槽类型
|
|
13
|
+
* */
|
|
14
|
+
export interface StFormLabelSlots {
|
|
15
|
+
/** 默认插槽 */
|
|
16
|
+
default?: () => unknown;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 表单验证消息组件属性
|
|
5
|
-
* */
|
|
6
|
-
export interface StFormMessageProps {
|
|
7
|
-
/** 验证错误消息 */
|
|
8
|
-
message?: string;
|
|
9
|
-
/** 自定义类名 */
|
|
10
|
-
class?: ClassValue;
|
|
11
|
-
/** 自定义样式 */
|
|
12
|
-
style?: StyleValue;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 表单验证消息组件插槽类型
|
|
17
|
-
* */
|
|
18
|
-
export interface StFormMessageSlots {
|
|
19
|
-
/** 默认插槽,用于自定义消息内容 */
|
|
20
|
-
default?: () => unknown;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {};
|
|
1
|
+
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 表单验证消息组件属性
|
|
5
|
+
* */
|
|
6
|
+
export interface StFormMessageProps {
|
|
7
|
+
/** 验证错误消息 */
|
|
8
|
+
message?: string;
|
|
9
|
+
/** 自定义类名 */
|
|
10
|
+
class?: ClassValue;
|
|
11
|
+
/** 自定义样式 */
|
|
12
|
+
style?: StyleValue;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 表单验证消息组件插槽类型
|
|
17
|
+
* */
|
|
18
|
+
export interface StFormMessageSlots {
|
|
19
|
+
/** 默认插槽,用于自定义消息内容 */
|
|
20
|
+
default?: () => unknown;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 图片适配模式类型
|
|
5
|
-
* */
|
|
6
|
-
export type StImageFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 图片组件属性
|
|
10
|
-
* */
|
|
11
|
-
export interface StImageProps {
|
|
12
|
-
/** 图片地址 */
|
|
13
|
-
src?: string;
|
|
14
|
-
/** 图片描述 */
|
|
15
|
-
alt?: string;
|
|
16
|
-
/** 图片适配模式 */
|
|
17
|
-
fit?: StImageFit;
|
|
18
|
-
/** 是否显示加载占位 */
|
|
19
|
-
showLoading?: boolean;
|
|
20
|
-
/** 是否显示错误占位 */
|
|
21
|
-
showError?: boolean;
|
|
22
|
-
/** 自定义加载占位类名 */
|
|
23
|
-
loadingClass?: ClassValue;
|
|
24
|
-
/** 自定义加载占位样式 */
|
|
25
|
-
loadingStyle?: StyleValue;
|
|
26
|
-
/** 自定义错误占位类名 */
|
|
27
|
-
errorClass?: ClassValue;
|
|
28
|
-
/** 自定义错误占位样式 */
|
|
29
|
-
errorStyle?: StyleValue;
|
|
30
|
-
/** 自定义图片类名 */
|
|
31
|
-
imageClass?: ClassValue;
|
|
32
|
-
/** 自定义图片样式 */
|
|
33
|
-
imageStyle?: StyleValue;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* 图片组件事件类型
|
|
38
|
-
* */
|
|
39
|
-
export interface StImageEmits {
|
|
40
|
-
/** 图片加载成功事件 */
|
|
41
|
-
load: [event: CustomEvent<{ width: number; height: number }>];
|
|
42
|
-
/** 图片加载失败事件 */
|
|
43
|
-
error: [event: Event];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* 图片组件插槽类型
|
|
48
|
-
* */
|
|
49
|
-
export interface StImageSlots {
|
|
50
|
-
/** 加载中占位插槽 */
|
|
51
|
-
loading?: () => unknown;
|
|
52
|
-
/** 加载失败占位插槽 */
|
|
53
|
-
error?: () => unknown;
|
|
54
|
-
/** 默认插槽 */
|
|
55
|
-
default?: () => unknown;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export {};
|
|
1
|
+
import type { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 图片适配模式类型
|
|
5
|
+
* */
|
|
6
|
+
export type StImageFit = 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 图片组件属性
|
|
10
|
+
* */
|
|
11
|
+
export interface StImageProps {
|
|
12
|
+
/** 图片地址 */
|
|
13
|
+
src?: string;
|
|
14
|
+
/** 图片描述 */
|
|
15
|
+
alt?: string;
|
|
16
|
+
/** 图片适配模式 */
|
|
17
|
+
fit?: StImageFit;
|
|
18
|
+
/** 是否显示加载占位 */
|
|
19
|
+
showLoading?: boolean;
|
|
20
|
+
/** 是否显示错误占位 */
|
|
21
|
+
showError?: boolean;
|
|
22
|
+
/** 自定义加载占位类名 */
|
|
23
|
+
loadingClass?: ClassValue;
|
|
24
|
+
/** 自定义加载占位样式 */
|
|
25
|
+
loadingStyle?: StyleValue;
|
|
26
|
+
/** 自定义错误占位类名 */
|
|
27
|
+
errorClass?: ClassValue;
|
|
28
|
+
/** 自定义错误占位样式 */
|
|
29
|
+
errorStyle?: StyleValue;
|
|
30
|
+
/** 自定义图片类名 */
|
|
31
|
+
imageClass?: ClassValue;
|
|
32
|
+
/** 自定义图片样式 */
|
|
33
|
+
imageStyle?: StyleValue;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 图片组件事件类型
|
|
38
|
+
* */
|
|
39
|
+
export interface StImageEmits {
|
|
40
|
+
/** 图片加载成功事件 */
|
|
41
|
+
load: [event: CustomEvent<{ width: number; height: number }>];
|
|
42
|
+
/** 图片加载失败事件 */
|
|
43
|
+
error: [event: Event];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 图片组件插槽类型
|
|
48
|
+
* */
|
|
49
|
+
export interface StImageSlots {
|
|
50
|
+
/** 加载中占位插槽 */
|
|
51
|
+
loading?: () => unknown;
|
|
52
|
+
/** 加载失败占位插槽 */
|
|
53
|
+
error?: () => unknown;
|
|
54
|
+
/** 默认插槽 */
|
|
55
|
+
default?: () => unknown;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export {};
|