troxler / vue-headful

Set document title and meta tags with Vue.js
MIT License
229 stars 17 forks source link

How to set property with special characters #10

Closed Overdrivr closed 5 years ago

Overdrivr commented 5 years ago

How can you set property og:title ?

Tried the following but apparently did not work (The tag is correctly added in my index.html):

:head="{
          'meta[og:title]': { 'og:title': 'FOO'},
      }"
troxler commented 5 years ago

The og:title is, by default, already defined by the title property. If you want to change it to a different value, you have to use the proper selector.

The element has to be predefined in your HTML as follows:

<meta property="og:title">

And the correct selector is this one:

:head="{
    'meta[property=\'og:title\']': {content: 'FOO'},
}"