cd-icon-picker 1.1.0 → 1.1.2
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/index.ts +6 -1
- package/package.json +1 -1
- package/src/Icon.vue +4 -4
- package/src/IconPicker.vue +2 -2
- package/src/SvgIcon.vue +2 -2
package/index.ts
CHANGED
|
@@ -3,12 +3,17 @@ import Icon from './src/Icon.vue';
|
|
|
3
3
|
import SvgIcon from './src/SvgIcon.vue';
|
|
4
4
|
import IconPicker from './src/IconPicker.vue';
|
|
5
5
|
|
|
6
|
+
// 别名导出
|
|
7
|
+
const CdIcon = Icon;
|
|
8
|
+
const CdSvgIcon = SvgIcon;
|
|
9
|
+
const CdIconPicker = IconPicker;
|
|
10
|
+
|
|
6
11
|
const install = (app: App) => {
|
|
7
12
|
app.component('CdIcon', Icon);
|
|
8
13
|
app.component('CdSvgIcon', SvgIcon);
|
|
9
14
|
app.component('CdIconPicker', IconPicker);
|
|
10
15
|
};
|
|
11
16
|
|
|
12
|
-
export { Icon, IconPicker, SvgIcon, install };
|
|
17
|
+
export { Icon, IconPicker, SvgIcon, CdIcon, CdSvgIcon, CdIconPicker, install };
|
|
13
18
|
|
|
14
19
|
export default IconPicker;
|
package/package.json
CHANGED
package/src/Icon.vue
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<SvgIcon v-if="isSvgIcon" :size="size" :name="getSvgIcon" :class="[$attrs.class, 'cd-icon']" :spin="spin" />
|
|
2
|
+
<SvgIcon v-if="isSvgIcon" :size="String(size)" :name="getSvgIcon" :class="[$attrs.class, 'cd-icon']" :spin="spin" />
|
|
3
3
|
<span v-else-if="isCompanyIcon" v-html="getCompanySvg" :class="['cd-icon', $attrs.class, spin && 'svg-icon-spin']" :style="getStyle"></span>
|
|
4
4
|
<i v-else-if="isRemixIcon" :class="['cd-icon', $attrs.class, icon, spin && 'svg-icon-spin']" :style="getStyle"></i>
|
|
5
|
-
<t-icon v-else :name="icon" :size="size" :color="color" :spin="spin" :class="[$attrs.class, 'cd-icon']" />
|
|
5
|
+
<t-icon v-else :name="icon" :size="String(size)" :color="color" :spin="spin" :class="[$attrs.class, 'cd-icon']" />
|
|
6
6
|
</template>
|
|
7
7
|
<script lang="ts">
|
|
8
8
|
import type { PropType } from 'vue';
|
|
@@ -23,8 +23,8 @@ export default defineComponent({
|
|
|
23
23
|
default: '',
|
|
24
24
|
},
|
|
25
25
|
size: {
|
|
26
|
-
type:
|
|
27
|
-
default: 16,
|
|
26
|
+
type: String,
|
|
27
|
+
default: '16',
|
|
28
28
|
},
|
|
29
29
|
spin: {
|
|
30
30
|
type: Boolean,
|
package/src/IconPicker.vue
CHANGED
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
<div class="cd-picker-header">
|
|
22
22
|
<span style="font-size: 14px;font-weight: normal;">当前图标:</span>
|
|
23
23
|
<span v-if="isSvgMode && currentSelect">
|
|
24
|
-
<SvgIcon :name="currentSelect" :prefix="svgPrefix" :size="20" />
|
|
24
|
+
<SvgIcon :name="currentSelect" :prefix="svgPrefix" :size="'20'" />
|
|
25
25
|
</span>
|
|
26
|
-
<Icon :icon="currentSelect || defaultIcon" :size="20" v-else />
|
|
26
|
+
<Icon :icon="currentSelect || defaultIcon" :size="'20'" v-else />
|
|
27
27
|
</div>
|
|
28
28
|
</template>
|
|
29
29
|
<div class="cd-picker-body">
|