浏览 156
分享
Plugin properties
VueMeta exports a Vue plugin as default export. This section describes the properties of that default export
version
- type
string
The 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
boolean
A 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
metaInfo
This method is similar to$meta.inject()
but works without the need for a Vue instance
import VueMeta from 'vue-meta'
const { generate } = VueMeta
const rawMetaInfo = {
meta: [{ charset: 'utf-8' }]
}
const metaInfo = generate(rawMetaInfo /*, yourOptions*/)
const HEAD = metaInfo.script.text() + metaInfo.meta.text()
will result In
<meta charset="utf-8">
评论列表