mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-08 17:02:25 +03:00
9cfde5b550
feat: update build script chore: use jiti instead of babel-node for examples
29 lines
582 B
TypeScript
29 lines
582 B
TypeScript
import { defineComponent, VNodeProps } from 'vue'
|
|
import { getCurrentManager } from './useApi'
|
|
import { MetainfoActive } from './types'
|
|
|
|
export interface MetainfoProps {
|
|
metainfo: MetainfoActive
|
|
}
|
|
|
|
export const MetainfoImpl = defineComponent({
|
|
name: 'Metainfo',
|
|
inheritAttrs: false,
|
|
setup (_, { slots }) {
|
|
return () => {
|
|
const manager = getCurrentManager()
|
|
if (!manager) {
|
|
return
|
|
}
|
|
|
|
return manager.render({ slots })
|
|
}
|
|
}
|
|
})
|
|
|
|
export const Metainfo = (MetainfoImpl as any) as {
|
|
new (): {
|
|
$props: VNodeProps & MetainfoProps
|
|
}
|
|
}
|