mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-15 23:42:24 +03:00
31 lines
645 B
JavaScript
31 lines
645 B
JavaScript
import { version } from '../package.json'
|
|
import createMixin from './shared/mixin'
|
|
import { setOptions } from './shared/options'
|
|
import $meta from './server/$meta'
|
|
import generate from './server/generate'
|
|
import { hasMetaInfo } from './shared/meta-helpers'
|
|
|
|
/**
|
|
* Plugin install function.
|
|
* @param {Function} Vue - the Vue constructor.
|
|
*/
|
|
function install (Vue, options = {}) {
|
|
if (Vue.__vuemeta_installed) {
|
|
return
|
|
}
|
|
Vue.__vuemeta_installed = true
|
|
|
|
options = setOptions(options)
|
|
|
|
Vue.prototype.$meta = $meta(options)
|
|
|
|
Vue.mixin(createMixin(Vue, options))
|
|
}
|
|
|
|
export default {
|
|
version,
|
|
install,
|
|
hasMetaInfo,
|
|
generate
|
|
}
|