首页html.js
<title></title> <meta name="keywords" content="" /> <meta name="description" content="">
路由router/indexjs
const routes = [{ path: "/index", name: "index", component: () => import ("../views/Index.vue"), meta: { title: "首页", content: { keywords: '关键词', description: '描述' } } }]
main.js
router.beforeEach((to, from, next) => { if (to.meta.content) { let head = document.getElementsByTagName('head'); let meta = document.createElement('meta'); document.querySelector('meta[name="keywords"]').setAttribute('content', to.meta.content.keywords) document.querySelector('meta[name="description"]').setAttribute('content', to.meta.content.description) meta.content = to.meta.content; head[0].appendChild(meta) } if (to.meta.title) { document.title = to.meta.title; } next() });
上面是“vuejs动态设置每个页面的标题、关键词和描述”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_1518.html
workflows工作流
一个孤独的斗篷人物站在一座巨大的雕塑旁
一位身着传统红色服装的女战士ComfyUI工作流
一辆停在混凝土墙前运动型SUV捷豹概念车
庭院,彩色玫瑰,云雾笼罩comfyui工作流
一个巨大的漆黑的蟹王ComfyUI工作流
一只躲在一堆秋叶里的小刺猬
一只穿着黑色蝴蝶结西装可爱橙色小猫
一只可爱的毛茸茸的猫ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!