Nuxt/test/fixtures/basic/plugins/my-plugin.ts

16 lines
285 B
TypeScript
Raw Permalink Normal View History

// @ts-expect-error
import { useHead } from '#head'
2022-03-08 18:03:21 +00:00
export default defineNuxtPlugin(() => {
useHead({
titleTemplate: '%s - Fixture'
})
const path = useRoute()?.path
2022-03-08 18:03:21 +00:00
return {
provide: {
myPlugin: () => 'Injected by my-plugin',
path: () => path
2022-03-08 18:03:21 +00:00
}
}
})