mirror of
https://gitee.com/JavaLionLi/plus-ui.git
synced 2026-09-13 07:43:43 +08:00
fix 修复 SvgLcon组件iconClass异常为空时白屏
This commit is contained in:
parent
3dcddd0f2c
commit
46fbc9db0b
@ -15,8 +15,8 @@ const props = defineProps({
|
|||||||
color: propTypes.string.def(''),
|
color: propTypes.string.def(''),
|
||||||
size: propTypes.string.def('')
|
size: propTypes.string.def('')
|
||||||
});
|
});
|
||||||
const normalizedIcon = computed(() => props.iconClass.replace(/^i-/, ''));
|
const normalizedIcon = computed(() => props.iconClass?.replace(/^i-/, ''));
|
||||||
const isIconify = computed(() => normalizedIcon.value.includes(':'));
|
const isIconify = computed(() => normalizedIcon.value?.includes(':'));
|
||||||
const iconName = computed(() => `#icon-${normalizedIcon.value}`);
|
const iconName = computed(() => `#icon-${normalizedIcon.value}`);
|
||||||
const svgClass = computed(() => {
|
const svgClass = computed(() => {
|
||||||
if (props.className) {
|
if (props.className) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user