useServerSeoMeta
useServerSeoMeta 可组合函数允许你将网站的 SEO 元标记定义为一个完全支持 TypeScript 的平面对象。
与 useSeoMeta
一样,useServerSeoMeta
可组合组件允许你将网站的 SEO 元标记定义为一个完全支持 TypeScript 的平面对象。
¥Just like useSeoMeta
, useServerSeoMeta
composable lets you define your site's SEO meta tags as a flat object with full TypeScript support.
在大多数情况下,元标记不需要具有响应性,因为搜索引擎机器人只会扫描初始加载。因此,我们建议将 useServerSeoMeta
用作注重性能的实用程序,它不会在客户端执行任何操作(或返回 head
对象)。
¥In most instances, the meta doesn't need to be reactive as robots will only scan the initial load. So we recommend using useServerSeoMeta
as a performance-focused utility that will not do anything (or return a head
object) on the client.
app.vue
<script setup lang="ts">
useServerSeoMeta({
robots: 'index, follow'
})
</script>
参数与 useSeoMeta
完全相同
¥Parameters are exactly the same as with useSeoMeta