Skip to content

Extend typescript definition for global properties #2164

Answered by kevcodez
kevcodez asked this question in Q&A
Discussion options

You must be logged in to vote

Fixed by moving to separate file and exporting an empty object.

export {}

declare module '@vue/runtime-core' {
    interface ComponentCustomProperties {
        $foo: string;
    }
}

Also see https://stackoverflow.com/questions/63999118/how-to-declare-typescript-type-interface-for-custom-meta-fields-in-vue-router-v4

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kevcodez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant