style: further fixing (not caught by eslint)

This commit is contained in:
Daniel Roe 2020-07-30 00:50:30 +01:00
parent fc0d1872e9
commit 82cd23e6da
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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
} }