700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > vue如何设置 网页标题 关键字 描述

vue如何设置 网页标题 关键字 描述

时间:2021-12-21 10:15:41

相关推荐

vue如何设置 网页标题 关键字 描述

前端面试秘籍:/yisainan/web-interview 欢迎star1.如果执行一次,在main.js中写;2.如果根据路由动态改变,在路由拦截router.beforeEach((to, from, next) => {}中写;

代码:

document.title = 接口获取的title || '默认title'

document.querySelector('meta[name="keywords"]').setAttribute('content', 接口获取的keywords) document.querySelector('meta[name="description"]').setAttribute('content', 接口获取的description)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。