fix(nuxt3): fix meta type generation (#628)

This commit is contained in:
Daniel Roe 2021-10-03 00:00:21 +01:00 committed by GitHub
parent 768488f07d
commit 48458e4544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 26 deletions

View File

@ -1,7 +1,7 @@
import { resolve } from 'pathe'
import { addPlugin, addTemplate, defineNuxtModule } from '@nuxt/kit'
import { distDir } from '../dirs'
import type { MetaObject } from './types'
import type { MetaObject } from './runtime'
export default defineNuxtModule({
name: 'meta',

View File

@ -1,7 +1,7 @@
import { isFunction } from '@vue/shared'
import { computed } from '@vue/reactivity'
import type { ComputedGetter } from '@vue/reactivity'
import type { MetaObject } from '../types'
import type { MetaObject } from './types'
import { useNuxtApp } from '#app'
/**

View File

@ -1 +1,2 @@
export * from './composables'
export * from './types'

View File

@ -1,6 +1,6 @@
import { createApp } from 'vue'
import { createMetaManager } from 'vue-meta'
import type { MetaObject } from '../../types'
import type { MetaObject } from '../types'
import { defineNuxtPlugin } from '#app'
export default defineNuxtPlugin((nuxt) => {

View File

@ -0,0 +1,21 @@
export interface MetaObject extends Record<string, any> {
/**
* The character encoding in which the document is encoded => `<meta charset="<value>" />`
*
* @default `'utf-8'`
*/
charset?: string
/**
* Configuration of the viewport (the area of the window in which web content can be seen),
* mapped to => `<meta name="viewport" content="<value>" />`
*
* @default `'width=device-width, initial-scale=1'`
*/
viewport?: string
}
declare module '@nuxt/kit' {
interface NuxtConfig {
meta?: MetaObject,
}
}

View File

@ -1,23 +0,0 @@
export * from './runtime/composables'
export interface MetaObject extends Record<string, any> {
/**
* The character encoding in which the document is encoded => `<meta charset="<value>" />`
*
* @default `'utf-8'`
*/
charset?: string
/**
* Configuration of the viewport (the area of the window in which web content can be seen),
* mapped to => `<meta name="viewport" content="<value>" />`
*
* @default `'width=device-width, initial-scale=1'`
*/
viewport?: string
}
declare module '@nuxt/kit' {
interface NuxtConfig {
meta?: MetaObject,
}
}