Skip to content

Improve typescript documentation to show how to use vue without imports that would require module bundler #2042

Closed
@realmerx

Description

@realmerx

Since currently type definitions for vue need to be exported, you have to use import:

//ItemComponentl.ts
import Vue from 'vue'

const ItemComponent = Vue.extend({
})

To get them work without import you can create custom type definition with declare global:

//global.d.ts - name does not matter
import { VueConstructor } from 'vue'

declare global {
    const Vue: VueConstructor
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions