Skip to content

Commit d8ddc6d

Browse files
committed
♻️ [refactor] : 아이콘 props interface 선언 및 간략화
1 parent 16ba6f5 commit d8ddc6d

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/components/CommonIcons.vue

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,8 @@
1717
</template>
1818

1919
<script setup lang="ts">
20-
import type { IconPathTypes } from '@/types/icon'
21-
import { defineProps, ref, type PropType } from 'vue'
20+
import type { IconProps } from '@/types/icon'
21+
import { defineProps, ref } from 'vue'
2222
const isHovered = ref(false)
23-
const { name, className, onClick } = defineProps({
24-
name: Object as PropType<IconPathTypes>,
25-
className: {
26-
type: String,
27-
required: false
28-
},
29-
onClick: {
30-
type: Function as PropType<(event: MouseEvent) => void>,
31-
required: false
32-
}
33-
})
23+
const { name, className, onClick } = defineProps<IconProps>()
3424
</script>

src/types/icon.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ interface IconOptions {
1515
fillRule?: 'evenodd' | 'inherit' | 'nonzero'
1616
clipRule?: 'evenodd' | 'inherit' | 'nonzero'
1717
}
18+
19+
export interface IconProps {
20+
name: IconPathTypes
21+
className?: string
22+
onClick?: () => void
23+
}

0 commit comments

Comments
 (0)