Plugin properties

VueMeta exports a Vue plugin as default export. This section describes the properties of that default export

version

  • type stringThe version of the plugin, it is the same as the package version

install

The method used by Vue to install the plugin

hasMetaInfo

  • argument:
    • vm (a Vue component)
  • returns booleanA helper function which returns true when the Vue component passed as argument has metaInfo defined

generate (since v2.2)

This method is not available in the browser builds

  • arguments:
    • metaInfo
    • options (optional)
  • returns metaInfoThis method is similar to $meta.inject() but works without the need for a Vue instance
  1. import VueMeta from 'vue-meta'
  2. const { generate } = VueMeta
  3. const rawMetaInfo = {
  4. meta: [{ charset: 'utf-8' }]
  5. }
  6. const metaInfo = generate(rawMetaInfo /*, yourOptions*/)
  7. const HEAD = metaInfo.script.text() + metaInfo.meta.text()

will result In

  1. <meta charset="utf-8">