Linux 拨号vps windows公众号手机端

vue中meta的用法

lewis 6年前 (2019-04-06) 阅读数 8 #程序编程
文章标签 vue

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')

版权声明

本文仅代表作者观点,不代表米安网络立场。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

热门