Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/cookbook/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,25 @@ export default Vue.extend({
import { Plugin } from '@nuxt/types'

declare module 'vue/types/vue' {
// this.$myInjectedFunction inside Vue components
interface Vue {
$myInjectedFunction(message: string): void
}
}

declare module '@nuxt/types' {
// nuxtContext.app.$myInjectedFunction inside asyncData, fetch, plugins, middleware, nuxtServerInit
interface NuxtAppOptions {
$myInjectedFunction(message: string): void
}
// nuxtContext.$myInjectedFunction
interface Context {
$myInjectedFunction(message: string): void
}
}

declare module 'vuex/types/index' {
// this.$myInjectedFunction inside Vuex stores
interface Store<S> {
$myInjectedFunction(message: string): void
}
Expand Down