fix: type error

This commit is contained in:
chansee97 2024-07-29 22:31:48 +08:00
parent 5cc410c7b4
commit 70c43a276c
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@
"build:dev": "vue-tsc --noEmit && vite build --mode dev", "build:dev": "vue-tsc --noEmit && vite build --mode dev",
"build:test": "vue-tsc --noEmit && vite build --mode test", "build:test": "vue-tsc --noEmit && vite build --mode test",
"preview": "vite preview --port 9981", "preview": "vite preview --port 9981",
"lint": "eslint .", "lint": "eslint . && vue-tsc --noEmit",
"lint:fix": "eslint . --fix", "lint:fix": "eslint . --fix",
"lint:check": "npx @eslint/config-inspector", "lint:check": "npx @eslint/config-inspector",
"sizecheck": "npx vite-bundle-visualizer" "sizecheck": "npx vite-bundle-visualizer"

View File

@ -3,7 +3,7 @@ import { Icon } from '@iconify/vue'
interface iconPorps { interface iconPorps {
/* 图标名称 */ /* 图标名称 */
icon: string icon?: string
/* 图标颜色 */ /* 图标颜色 */
color?: string color?: string
/* 图标大小 */ /* 图标大小 */
@ -16,7 +16,7 @@ const props = withDefaults(defineProps<iconPorps>(), {
}) })
const isLocal = computed(() => { const isLocal = computed(() => {
return props.icon.startsWith('local:') return props.icon && props.icon.startsWith('local:')
}) })
function getLocalIcon(icon: string) { function getLocalIcon(icon: string) {