SSR渲染--04--SEO优化

因为之前说服务端渲染不利于SEO优化,

全局

我们可以在nuxt.config.js配置文件中修改

 head: {
    title: 'vue-honor-of-kings',
    htmlAttrs: {
      lang: 'en'
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
      { name: 'format-detection', content: 'telephone=no' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },

局部
在单页面设置SEO,可以设置在heard 方法里

  head(){
      return{
          title:'王者助手',
          meta:[{
              'name':'keywords',
              'content': '貂蝉,妲己,程咬金'
          }]
      }
  },

SSR渲染--04--SEO优化_第1张图片

你可能感兴趣的:(数学建模)