[Vuejs]-How to extend VueConfiguration? I.e. how to extend existing interface?

0šŸ‘

Iā€™m not aware of a way to modify an existing interface. Rather, you should create a new interface that extends the old interface and then use a type assertion on your object to let the TS compiler know about these additional properties.

export interface MyVueConfiguration extends VueConfiguration {
    server: {
        user: string;
    }
}

...

(Vue.config as MyVueConfiguration).server.user = 'http://127.0.0.1:8082'

Leave a comment