mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 22:55:13 +00:00
style: further fixing (not caught by eslint)
This commit is contained in:
parent
fc0d1872e9
commit
82cd23e6da
@ -14,14 +14,14 @@ export class Nuxt extends Hookable {
|
|||||||
res?: ServerResponse
|
res?: ServerResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor({ app, ssrContext, globalName }: { app: Nuxt['app'], ssrContext?: Nuxt['ssrContext'], globalName: Nuxt['globalName'] }) {
|
constructor ({ app, ssrContext, globalName }: { app: Nuxt['app'], ssrContext?: Nuxt['ssrContext'], globalName: Nuxt['globalName'] }) {
|
||||||
super()
|
super()
|
||||||
this.app = app
|
this.app = app
|
||||||
this.ssrContext = ssrContext
|
this.ssrContext = ssrContext
|
||||||
this.globalName = globalName
|
this.globalName = globalName
|
||||||
}
|
}
|
||||||
|
|
||||||
provide(name: string, value: any) {
|
provide (name: string, value: any) {
|
||||||
const $name = '$' + name
|
const $name = '$' + name
|
||||||
defineGetter(this.app, $name, value)
|
defineGetter(this.app, $name, value)
|
||||||
defineGetter(this.app.config.globalProperties, $name, value)
|
defineGetter(this.app.config.globalProperties, $name, value)
|
||||||
@ -35,7 +35,7 @@ interface InitOptions {
|
|||||||
globalName?: Nuxt['globalName']
|
globalName?: Nuxt['globalName']
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function init({ app, plugins, ssrContext, globalName = 'nuxt' }: InitOptions) {
|
export async function init ({ app, plugins, ssrContext, globalName = 'nuxt' }: InitOptions) {
|
||||||
const nuxt = new Nuxt({ app, ssrContext, globalName })
|
const nuxt = new Nuxt({ app, ssrContext, globalName })
|
||||||
nuxt.provide('nuxt', nuxt)
|
nuxt.provide('nuxt', nuxt)
|
||||||
|
|
||||||
|
@ -2,4 +2,4 @@ import type { Nuxt } from './nuxt';
|
|||||||
|
|
||||||
export interface Plugin {
|
export interface Plugin {
|
||||||
(nuxt: Nuxt, inject?: Nuxt['provide']): Promise<void> | void
|
(nuxt: Nuxt, inject?: Nuxt['provide']): Promise<void> | void
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user