@ecolovo/uniapp-components 2.0.7 → 2.0.9
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/components/badge/badge.vue +2 -2
- package/components/badge/types.d.ts +0 -2
- package/components/badge/types.js +1 -4
- package/components/badge/types.ts +0 -6
- package/components/button/button.vue +2 -2
- package/components/button/types.d.ts +0 -2
- package/components/button/types.js +1 -4
- package/components/button/types.ts +0 -6
- package/components/checkbox/checkbox.vue +2 -2
- package/components/checkbox/types.d.ts +0 -2
- package/components/checkbox/types.js +1 -4
- package/components/checkbox/types.ts +0 -8
- package/components/checkbox-group/checkbox-group.vue +2 -2
- package/components/checkbox-group/types.d.ts +0 -2
- package/components/checkbox-group/types.js +1 -8
- package/components/checkbox-group/types.ts +0 -12
- package/components/checkbox-group2/checkbox-group2.vue +2 -2
- package/components/date-picker/date-picker.vue +2 -2
- package/components/date-picker/types.d.ts +0 -2
- package/components/date-picker/types.js +1 -4
- package/components/date-picker/types.ts +0 -8
- package/components/dialog/dialog.vue +2 -2
- package/components/dialog/types.d.ts +0 -2
- package/components/dialog/types.js +1 -4
- package/components/dialog/types.ts +0 -6
- package/components/dropdown/dropdown.vue +2 -2
- package/components/dropdown/types.d.ts +0 -2
- package/components/dropdown/types.js +1 -4
- package/components/dropdown/types.ts +0 -8
- package/components/empty/empty.vue +2 -2
- package/components/empty/types.d.ts +0 -2
- package/components/empty/types.js +1 -9
- package/components/empty/types.ts +0 -11
- package/components/flex/flex.vue +2 -2
- package/components/flex/types.d.ts +0 -2
- package/components/flex/types.js +1 -4
- package/components/flex/types.ts +0 -6
- package/components/form/form.vue +2 -2
- package/components/form/types.d.ts +0 -2
- package/components/form/types.js +1 -4
- package/components/form/types.ts +0 -6
- package/components/form-item/form-item.vue +2 -2
- package/components/form-item/types.d.ts +0 -2
- package/components/form-item/types.js +1 -4
- package/components/form-item/types.ts +0 -8
- package/components/icon/icon.vue +59 -1
- package/components/image/image.vue +3 -2
- package/components/image/types.d.ts +0 -2
- package/components/image/types.js +1 -4
- package/components/image/types.ts +0 -6
- package/components/input/input.vue +2 -2
- package/components/input/password-input.vue +2 -2
- package/components/input/types.d.ts +0 -4
- package/components/input/types.js +1 -8
- package/components/input/types.ts +0 -14
- package/components/list-page/list-page.vue +2 -2
- package/components/list-page/types.d.ts +0 -2
- package/components/list-page/types.js +1 -4
- package/components/list-page/types.ts +0 -8
- package/components/load-more/load-more.vue +2 -2
- package/components/load-more/types.d.ts +0 -2
- package/components/load-more/types.js +1 -4
- package/components/load-more/types.ts +0 -8
- package/components/loading/loading.vue +2 -2
- package/components/loading/types.d.ts +0 -2
- package/components/loading/types.js +1 -4
- package/components/loading/types.ts +0 -8
- package/components/message-box/message-box.vue +2 -2
- package/components/message-box/types.d.ts +0 -2
- package/components/message-box/types.js +1 -4
- package/components/message-box/types.ts +0 -8
- package/components/number-dialog/number-dialog.vue +2 -2
- package/components/number-dialog/types.d.ts +0 -2
- package/components/number-dialog/types.js +1 -4
- package/components/number-dialog/types.ts +0 -8
- package/components/number-input/number-input.vue +2 -2
- package/components/number-input/types.d.ts +0 -2
- package/components/number-input/types.js +1 -4
- package/components/number-input/types.ts +0 -8
- package/components/numpad/numpad.vue +2 -2
- package/components/numpad/types.d.ts +0 -2
- package/components/numpad/types.js +1 -4
- package/components/numpad/types.ts +0 -6
- package/components/page/page-header.vue +7 -7
- package/components/page/page.vue +2 -2
- package/components/page/types.d.ts +0 -4
- package/components/page/types.js +1 -8
- package/components/page/types.ts +0 -14
- package/components/picker/picker.vue +2 -2
- package/components/picker/types.d.ts +0 -2
- package/components/picker/types.js +1 -4
- package/components/picker/types.ts +0 -6
- package/components/popover/popover.vue +2 -2
- package/components/popover/types.d.ts +0 -2
- package/components/popover/types.js +1 -4
- package/components/popover/types.ts +0 -8
- package/components/popup/popup.vue +2 -2
- package/components/popup/types.d.ts +0 -2
- package/components/popup/types.js +1 -4
- package/components/popup/types.ts +0 -6
- package/components/price/price.vue +2 -2
- package/components/price/types.d.ts +0 -2
- package/components/price/types.js +1 -4
- package/components/price/types.ts +0 -6
- package/components/search/search.vue +2 -2
- package/components/search/types.d.ts +0 -2
- package/components/search/types.js +1 -4
- package/components/search/types.ts +0 -6
- package/components/searching/searching.vue +2 -2
- package/components/searching/types.d.ts +0 -2
- package/components/searching/types.js +1 -4
- package/components/searching/types.ts +0 -8
- package/components/switch/switch.vue +2 -2
- package/components/switch/types.d.ts +0 -2
- package/components/switch/types.js +1 -4
- package/components/switch/types.ts +0 -6
- package/components/tab/tab.vue +2 -2
- package/components/tab/types.d.ts +0 -2
- package/components/tab/types.js +1 -4
- package/components/tab/types.ts +0 -6
- package/components/textarea/textarea.vue +2 -2
- package/components/textarea/types.d.ts +0 -2
- package/components/textarea/types.js +1 -4
- package/components/textarea/types.ts +0 -8
- package/components/upload/media-upload.vue +4 -3
- package/components/upload/types.d.ts +0 -2
- package/components/upload/types.js +1 -4
- package/components/upload/types.ts +0 -8
- package/composable/component-name.js +2 -2
- package/composable/component-name.ts +2 -2
- package/composable/message-box.d.ts +2 -2
- package/composable/message-box.js +6 -6
- package/composable/message-box.ts +14 -8
- package/composable/page.js +2 -2
- package/composable/page.ts +2 -2
- package/configs/index.d.ts +9 -45
- package/configs/index.js +9 -70
- package/configs/index.ts +9 -103
- package/globals.d.ts +8 -0
- package/globals.ts +7 -0
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/index.ts +0 -1
- package/package.json +1 -1
- package/styles/global.scss +3 -0
- package/vite.d.ts +22 -0
- package/vite.js +68 -0
- package/vite.ts +107 -0
- package/init.d.ts +0 -21
- package/init.js +0 -91
- package/init.ts +0 -119
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<script lang="ts" setup>
|
|
17
17
|
import { computed } from 'vue';
|
|
18
18
|
import useClassNames from '../../composable/component-name';
|
|
19
|
-
import {
|
|
19
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
20
20
|
|
|
21
21
|
defineOptions({
|
|
22
22
|
options: {
|
|
@@ -47,7 +47,7 @@ type _Props = {
|
|
|
47
47
|
const props = withDefaults(defineProps<_Props>(), {
|
|
48
48
|
value: 0,
|
|
49
49
|
max: 99,
|
|
50
|
-
...
|
|
50
|
+
...EC_DEFAULT_PROPS.badge,
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
const showValue = computed(() => {
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
<script lang="ts" setup>
|
|
78
78
|
import { computed, ref, useCssModule } from 'vue';
|
|
79
79
|
import useClassNames from '../../composable/component-name';
|
|
80
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
80
81
|
import IconCpn from '../icon/icon.vue';
|
|
81
|
-
import { buttonProps } from './types';
|
|
82
82
|
|
|
83
83
|
defineOptions({
|
|
84
84
|
options: {
|
|
@@ -149,7 +149,7 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
149
149
|
showLoading: undefined,
|
|
150
150
|
small: false,
|
|
151
151
|
large: false,
|
|
152
|
-
...
|
|
152
|
+
...EC_DEFAULT_PROPS.button,
|
|
153
153
|
});
|
|
154
154
|
|
|
155
155
|
const emit = defineEmits<{
|
|
@@ -20,7 +20,7 @@ import { computed, inject, ref } from 'vue';
|
|
|
20
20
|
import type { ComputedRef, Ref } from 'vue';
|
|
21
21
|
import IconCpn from '../icon/icon.vue';
|
|
22
22
|
import useClassNames from '../../composable/component-name';
|
|
23
|
-
import {
|
|
23
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
24
24
|
|
|
25
25
|
defineOptions({
|
|
26
26
|
options: {
|
|
@@ -79,7 +79,7 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
79
79
|
icon: undefined,
|
|
80
80
|
checkedIcon: '',
|
|
81
81
|
uncheckedIcon: '',
|
|
82
|
-
...
|
|
82
|
+
...EC_DEFAULT_PROPS.checkbox,
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
const emit = defineEmits<{
|
|
@@ -6,11 +6,3 @@ export type ConfigurableCheckboxProps = {
|
|
|
6
6
|
/** 未选中时的图标 */
|
|
7
7
|
uncheckedIcon?: string;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
export let checkboxProps: ConfigurableCheckboxProps = {};
|
|
11
|
-
|
|
12
|
-
export const setDefaultCheckboxProps = (
|
|
13
|
-
props: ConfigurableCheckboxProps = {}
|
|
14
|
-
) => {
|
|
15
|
-
checkboxProps = props;
|
|
16
|
-
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
8
|
import { computed, provide, ref, watch } from 'vue';
|
|
9
9
|
import useClassNames from '../../composable/component-name';
|
|
10
|
-
import {
|
|
10
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
11
11
|
|
|
12
12
|
defineOptions({
|
|
13
13
|
options: {
|
|
@@ -37,7 +37,7 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
37
37
|
icon: true,
|
|
38
38
|
checkedIcon: '',
|
|
39
39
|
uncheckedIcon: '',
|
|
40
|
-
...
|
|
40
|
+
...EC_DEFAULT_PROPS.checkboxGroup,
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
const emit = defineEmits<{
|
|
@@ -6,15 +6,3 @@ export type ConfigurableCheckboxGroupProps = {
|
|
|
6
6
|
/** 未选中时的图标 */
|
|
7
7
|
uncheckedIcon?: string;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
export let checkboxGroupProps: ConfigurableCheckboxGroupProps = {
|
|
11
|
-
icon: true,
|
|
12
|
-
checkedIcon: '',
|
|
13
|
-
uncheckedIcon: '',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const setDefaultCheckboxGroupProps = (
|
|
17
|
-
props: ConfigurableCheckboxGroupProps = {}
|
|
18
|
-
) => {
|
|
19
|
-
checkboxGroupProps = props;
|
|
20
|
-
};
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
<script lang="ts" setup>
|
|
29
29
|
import { computed, ref } from 'vue';
|
|
30
30
|
import useClassNames from '../../composable/component-name';
|
|
31
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
31
32
|
import Checkbox2Cpn from './checkbox2.vue';
|
|
32
|
-
import { checkboxGroupProps } from '../checkbox-group/types';
|
|
33
33
|
|
|
34
34
|
defineOptions({
|
|
35
35
|
options: {
|
|
@@ -68,7 +68,7 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
68
68
|
icon: true,
|
|
69
69
|
checkedIcon: undefined,
|
|
70
70
|
uncheckedIcon: undefined,
|
|
71
|
-
...
|
|
71
|
+
...EC_DEFAULT_PROPS.checkboxGroup,
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
const emit = defineEmits<{
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
|
|
71
71
|
<script lang="ts" setup>
|
|
72
72
|
import { computed, inject, ref } from 'vue';
|
|
73
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
73
74
|
import useClassNames from '../../composable/component-name';
|
|
74
75
|
import { formatDate, toDate } from '../../utils/date';
|
|
75
76
|
import PopupCpn from '../popup/popup.vue';
|
|
76
77
|
import SelectorCpn from '../selector/selector.vue';
|
|
77
78
|
import DatePickerViewCpn from './date-picker-view.vue';
|
|
78
|
-
import { datePickerProps } from './types';
|
|
79
79
|
|
|
80
80
|
defineOptions({
|
|
81
81
|
options: {
|
|
@@ -120,7 +120,7 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
120
120
|
timeAppend: '',
|
|
121
121
|
min: '',
|
|
122
122
|
max: '',
|
|
123
|
-
...
|
|
123
|
+
...EC_DEFAULT_PROPS.datePicker,
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
const emit = defineEmits<{
|
|
@@ -8,5 +8,3 @@ export type ConfigurableDatePickerProps = {
|
|
|
8
8
|
/** 在选择的日期后面拼接时间字符串,如果传入的是数组,会分别对应添加到范围日期值后 */
|
|
9
9
|
timeAppend?: string | (() => string[]);
|
|
10
10
|
};
|
|
11
|
-
export declare let datePickerProps: ConfigurableDatePickerProps;
|
|
12
|
-
export declare const setDefaultDatePickerProps: (props?: ConfigurableDatePickerProps) => void;
|
|
@@ -8,11 +8,3 @@ export type ConfigurableDatePickerProps = {
|
|
|
8
8
|
/** 在选择的日期后面拼接时间字符串,如果传入的是数组,会分别对应添加到范围日期值后 */
|
|
9
9
|
timeAppend?: string | (() => string[]);
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
export let datePickerProps: ConfigurableDatePickerProps = {};
|
|
13
|
-
|
|
14
|
-
export const setDefaultDatePickerProps = (
|
|
15
|
-
props: ConfigurableDatePickerProps = {}
|
|
16
|
-
) => {
|
|
17
|
-
datePickerProps = props;
|
|
18
|
-
};
|
|
@@ -37,8 +37,8 @@ import { ref, computed, useSlots } from 'vue';
|
|
|
37
37
|
import useClassNames from '../../composable/component-name';
|
|
38
38
|
import PopoverMaskCpn from '../popover/popover-mask.vue';
|
|
39
39
|
import DialogContentCpn from './dialog-content.vue';
|
|
40
|
-
import { dialogProps } from './types';
|
|
41
40
|
import { useAwaitableDialog, useModelValue } from '../../composable';
|
|
41
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
42
42
|
|
|
43
43
|
defineOptions({
|
|
44
44
|
options: {
|
|
@@ -105,7 +105,7 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
105
105
|
confirm: '确认',
|
|
106
106
|
closeOnConfirm: true,
|
|
107
107
|
async: false,
|
|
108
|
-
...
|
|
108
|
+
...EC_DEFAULT_PROPS.dialog,
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
const emit = defineEmits<{
|
|
@@ -16,9 +16,3 @@ export type ConfigurableDialogProps = {
|
|
|
16
16
|
/** 点击确认按钮时是否自动关闭对话框 */
|
|
17
17
|
closeOnConfirm?: boolean;
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
export let dialogProps: ConfigurableDialogProps = {};
|
|
21
|
-
|
|
22
|
-
export const setDefaultDialogProps = (props: ConfigurableDialogProps = {}) => {
|
|
23
|
-
dialogProps = props;
|
|
24
|
-
};
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
<script lang="ts" setup>
|
|
29
29
|
import { computed } from 'vue';
|
|
30
30
|
import useClassNames from '../../composable/component-name';
|
|
31
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
31
32
|
import IconCpn from '../icon/icon.vue';
|
|
32
|
-
import { dropdownProps } from './types';
|
|
33
33
|
|
|
34
34
|
defineOptions({
|
|
35
35
|
options: {
|
|
@@ -59,7 +59,7 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
59
59
|
align: '',
|
|
60
60
|
multiple: true,
|
|
61
61
|
formatter: null,
|
|
62
|
-
...
|
|
62
|
+
...EC_DEFAULT_PROPS.dropdown,
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
/** 是否选择了值 */
|
|
@@ -6,11 +6,3 @@ export type ConfigurableDropdownProps = {
|
|
|
6
6
|
/** 展示值格式化函数 */
|
|
7
7
|
formatter?: ((val: unknown) => string) | null;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
export let dropdownProps: ConfigurableDropdownProps = {};
|
|
11
|
-
|
|
12
|
-
export const setDefaultDropdownProps = (
|
|
13
|
-
props: ConfigurableDropdownProps = {}
|
|
14
|
-
) => {
|
|
15
|
-
dropdownProps = props;
|
|
16
|
-
};
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
import useClassNames from '../../composable/component-name';
|
|
43
43
|
import IconCpn from '../icon/icon.vue';
|
|
44
44
|
import emptyImage from '../../resources/image/empty.svg';
|
|
45
|
-
import {
|
|
45
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
46
46
|
|
|
47
47
|
defineOptions({
|
|
48
48
|
options: {
|
|
@@ -72,7 +72,7 @@ withDefaults(defineProps<_Props>(), {
|
|
|
72
72
|
loading: false,
|
|
73
73
|
loadingImage: '',
|
|
74
74
|
loadingText: '数据加载中',
|
|
75
|
-
...
|
|
75
|
+
...EC_DEFAULT_PROPS.empty,
|
|
76
76
|
});
|
|
77
77
|
</script>
|
|
78
78
|
|
|
@@ -8,14 +8,3 @@ export type ConfigurableEmptyProps = {
|
|
|
8
8
|
/** 加载中文本 */
|
|
9
9
|
loadingText?: string;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
export let emptyProps: ConfigurableEmptyProps = {
|
|
13
|
-
image: '',
|
|
14
|
-
text: '暂无数据',
|
|
15
|
-
loadingImage: '',
|
|
16
|
-
loadingText: '数据加载中',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const setDefaultEmptyProps = (props: ConfigurableEmptyProps = {}) => {
|
|
20
|
-
emptyProps = props;
|
|
21
|
-
};
|
package/components/flex/flex.vue
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
8
|
import { computed } from 'vue';
|
|
9
9
|
import useClassNames from '../../composable/component-name';
|
|
10
|
-
import {
|
|
10
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
11
11
|
|
|
12
12
|
defineOptions({
|
|
13
13
|
options: {
|
|
@@ -43,7 +43,7 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
43
43
|
align: 'center',
|
|
44
44
|
wrap: false,
|
|
45
45
|
gap: '0px',
|
|
46
|
-
...
|
|
46
|
+
...EC_DEFAULT_PROPS.flex,
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
const gapValue = computed(() => {
|
package/components/flex/types.js
CHANGED
package/components/flex/types.ts
CHANGED
|
@@ -14,9 +14,3 @@ export type ConfigurableFlexProps = {
|
|
|
14
14
|
/** 间距 */
|
|
15
15
|
gap?: string | number | (() => (string | number)[]);
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
export let flexProps: ConfigurableFlexProps = {};
|
|
19
|
-
|
|
20
|
-
export const setDefaultFlexProps = (props: ConfigurableFlexProps = {}) => {
|
|
21
|
-
flexProps = props;
|
|
22
|
-
};
|
package/components/form/form.vue
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
8
|
import { computed, provide } from 'vue';
|
|
9
9
|
import useClassNames from '../../composable/component-name';
|
|
10
|
-
import {
|
|
10
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
11
11
|
|
|
12
12
|
defineOptions({
|
|
13
13
|
options: {
|
|
@@ -28,7 +28,7 @@ type _Props = {
|
|
|
28
28
|
const props = withDefaults(defineProps<_Props>(), {
|
|
29
29
|
readonly: false,
|
|
30
30
|
type: 'line',
|
|
31
|
-
...
|
|
31
|
+
...EC_DEFAULT_PROPS.form,
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
provide(
|
package/components/form/types.js
CHANGED
package/components/form/types.ts
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
import { computed, inject } from 'vue';
|
|
32
32
|
import type { ComputedRef } from 'vue';
|
|
33
33
|
import useClassNames from '../../composable/component-name';
|
|
34
|
-
import {
|
|
34
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
35
35
|
|
|
36
36
|
defineOptions({
|
|
37
37
|
options: {
|
|
@@ -58,7 +58,7 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
58
58
|
subLabel: '',
|
|
59
59
|
required: false,
|
|
60
60
|
type: undefined,
|
|
61
|
-
...
|
|
61
|
+
...EC_DEFAULT_PROPS.formItem,
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
/** 表单是否只读 */
|
|
@@ -2,11 +2,3 @@ export type ConfigurableFormItemProps = {
|
|
|
2
2
|
/** 表单显示类型 */
|
|
3
3
|
type?: 'line' | 'next' | 'block';
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
export let formItemProps: ConfigurableFormItemProps = {};
|
|
7
|
-
|
|
8
|
-
export const setDefaultFormItemProps = (
|
|
9
|
-
props: ConfigurableFormItemProps = {}
|
|
10
|
-
) => {
|
|
11
|
-
formItemProps = props;
|
|
12
|
-
};
|
package/components/icon/icon.vue
CHANGED
|
@@ -13,10 +13,68 @@
|
|
|
13
13
|
</text>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
import defaultIconFonts from '../../resources/iconfont/uniapp_ui_icon/iconfont.json';
|
|
18
|
+
import { EC_USE_INNER_ICON, EC_ICON_FONT } from '../../configs/index';
|
|
19
|
+
|
|
20
|
+
/** Icon */
|
|
21
|
+
interface IconInfo {
|
|
22
|
+
/** 字体文件名 */
|
|
23
|
+
fontFamily: string;
|
|
24
|
+
/** 图标前缀 */
|
|
25
|
+
prefix: string;
|
|
26
|
+
/** 图标名称 */
|
|
27
|
+
name: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** iconfont 图标 map */
|
|
31
|
+
const iconMap: Map<string, IconInfo> = new Map();
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 添加单个图标
|
|
35
|
+
*
|
|
36
|
+
* @param fontFamily 字体文件名
|
|
37
|
+
* @param prefix 图标前缀
|
|
38
|
+
* @param name 图标名称
|
|
39
|
+
*/
|
|
40
|
+
function addIconToMap(fontFamily: string, prefix: string, name: string) {
|
|
41
|
+
if (iconMap.has(name)) {
|
|
42
|
+
// eslint-disable-next-line no-console
|
|
43
|
+
console.warn(
|
|
44
|
+
`图标库 "${fontFamily}" 中的图标 "${name}" 在图标库 "${
|
|
45
|
+
iconMap.get(name)!.fontFamily
|
|
46
|
+
}" 中已存在,新的图标将会覆盖已存在的同名图标`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
iconMap.set(name, {
|
|
50
|
+
fontFamily,
|
|
51
|
+
prefix,
|
|
52
|
+
name,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 添加一组图标,传入 iconfont.json 文件内容
|
|
58
|
+
*
|
|
59
|
+
* @param iconJson iconfont.json 文件内容
|
|
60
|
+
*/
|
|
61
|
+
function addIcons(iconJson: IconFontJson) {
|
|
62
|
+
const fontFamily = iconJson.font_family;
|
|
63
|
+
const prefix = iconJson.css_prefix_text;
|
|
64
|
+
const glyphs = iconJson.glyphs;
|
|
65
|
+
glyphs.forEach((glyph) => {
|
|
66
|
+
addIconToMap(fontFamily, prefix, glyph.font_class);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 添加内部图标库
|
|
71
|
+
if (EC_USE_INNER_ICON) addIcons(defaultIconFonts);
|
|
72
|
+
// 添加额外 IconFont
|
|
73
|
+
EC_ICON_FONT.forEach(addIcons);
|
|
74
|
+
</script>
|
|
16
75
|
<script lang="ts" setup>
|
|
17
76
|
import { computed } from 'vue';
|
|
18
77
|
import useClassNames from '../../composable/component-name';
|
|
19
|
-
import { iconMap } from '../../configs';
|
|
20
78
|
|
|
21
79
|
defineOptions({
|
|
22
80
|
options: {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
<script lang="ts" setup>
|
|
14
14
|
import { computed } from 'vue';
|
|
15
15
|
import useClassNames from '../../composable/component-name';
|
|
16
|
-
import {
|
|
16
|
+
import { EC_DEFAULT_PROPS } from '../../configs';
|
|
17
|
+
import { type ImageProps } from './types';
|
|
17
18
|
|
|
18
19
|
defineOptions({
|
|
19
20
|
options: {
|
|
@@ -39,7 +40,7 @@ const props = withDefaults(defineProps<_Props>(), {
|
|
|
39
40
|
lazyLoad: false,
|
|
40
41
|
preview: false,
|
|
41
42
|
previewIndex: undefined,
|
|
42
|
-
...
|
|
43
|
+
...EC_DEFAULT_PROPS.image,
|
|
43
44
|
});
|
|
44
45
|
|
|
45
46
|
const emit = defineEmits<{
|