Skip to content

Commit a3bc315

Browse files
authored
fix: use type alias instead of interface for Props definitions (#518)
Use `type` instead of `interface` for Props definitions to align with Vue ecosystem best practices. Type aliases are more flexible for union and intersection types, which is the recommended approach in Vue's official documentation and the broader Vue community. This addresses feedback from GitHub Copilot review on PR #517.
1 parent b282d69 commit a3bc315

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/JsonTreeView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
export type ColorScheme = 'light' | 'dark'
33
4-
export interface Props {
4+
export type Props = {
55
json: string
66
rootKey?: string
77
maxDepth?: number

src/components/JsonTreeViewItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type ItemData = {
2323
value?: PrimitiveTypes
2424
}
2525
26-
export interface Props {
26+
export type Props = {
2727
data: ItemData
2828
maxDepth?: number
2929
canSelect?: boolean

0 commit comments

Comments
 (0)