vue

vue中meta的用法

清风
1593
2021-03-15 09:11:21
栏目: 编程语言

vue中meta的用法

vue-meta 主要用于管理 HMTL 头部标签,同时也支持 SSR。基本用法,在main.js中使用:vue中meta主要用于管理HMTL头部标签,能够支持SSR,基本用法如下:

//在main.js中使用

import Meta from 'vue-meta';

Vue.use(Meta)

new Vue({

router,

data:{

title: 'How to use vue-meta',

keywords:'vue,vue-router,vue-meta',

description:'this is a des info.'

},

//定义metaInfo

metaInfo(){

return(){

title: this.title,

meta:[

{

name:'keywords',

content:this.keywords

},{

name:"description",

content:this.description

}

]

}

},

render: h=>(APP)

}).$mount('#app')

0
看了该问题的人还看了