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

16 lines
285 B
TypeScript

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