Skip to main content

<svelte:head>

<svelte:head>...</svelte:head>

此元素可以将元素插入 document.head。在服务器端渲染过程中,head 内容与主 body 内容分开公开。

¥This element makes it possible to insert elements into document.head. During server-side rendering, head content is exposed separately to the main body content.

<svelte:window><svelte:document><svelte:body> 一样,此元素只能出现在组件的顶层,并且绝不能位于块或元素内。

¥As with <svelte:window>, <svelte:document> and <svelte:body>, this element may only appear at the top level of your component and must never be inside a block or element.

<svelte:head>
	<title>Hello world!</title>
	<meta name="description" content="This is where the description goes for SEO" />
</svelte:head>
上一页 下一页