【发布时间】:2021-04-06 07:43:35
【问题描述】:
这是我在组件脚本中的代码:检查时标题标签不显示
import { useMeta } from "@nuxtjs/composition-api";
export default {
components: { },
head: {},
setup() {
useMeta({
title: 'My title',
meta: [
{
hid: 'description',
name: 'description',
content: 'My description',
},
],
})
const screenType = ref("desktop");
var deviceType = ""
// const screenType = ref("mobile")
// const screenType = ref("landscape")
if (process.browser) {
window.onNuxtReady(() => {
if (window.innerWidth < 500) {
screenType.value = "mobile";
} else {
screenType.value = "desktop";
}
if (navigator.userAgent.match(/mobile/i)) {
deviceType = "mobile";
} else if (navigator.userAgent.match(/iPad|Android|Touch/i)) {
deviceType = "tablet";
} else {
deviceType = "desktop";
}
})
}
} }
我的nuxt.config.js中没有头对象
我在这里错过了什么?
【问题讨论】: