Head

管理文档 <head> 中的内容,支持 SSR。

Props

ts
interface HeadProps {
  children: View | View[]
}
属性类型说明
childrenView | View[]要插入到 head 的内容

示例

tsx
import { Head } from 'vitarx'

function BlogPost(props: { title: string }) {
  return (
    <div>
      <Head>
        <title>{props.title}</title>
        <meta name="description" content="Blog post" />
      </Head>
      <h1>{props.title}</h1>
    </div>
  )
}

参考Head 详解