fix(components): add type annotations in MentionList.vue
- Import PropType and MentionNodeAttrs - Add MentionItem interface - Add PropType for items array and command function
This commit is contained in:
parent
30101308ea
commit
642cd08b9d
|
|
@ -37,15 +37,25 @@
|
|||
|
||||
<script lang="ts">
|
||||
/* eslint-disable vue/component-api-style */
|
||||
import type {PropType} from 'vue'
|
||||
import type {MentionNodeAttrs} from '@tiptap/extension-mention'
|
||||
|
||||
interface MentionItem extends MentionNodeAttrs {
|
||||
id: string
|
||||
label: string
|
||||
username: string
|
||||
avatarUrl: string
|
||||
}
|
||||
|
||||
export default {
|
||||
props: {
|
||||
items: {
|
||||
type: Array,
|
||||
type: Array as PropType<MentionItem[]>,
|
||||
required: true,
|
||||
},
|
||||
|
||||
command: {
|
||||
type: Function,
|
||||
type: Function as PropType<(item: MentionItem) => void>,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue