mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-07 23:02:25 +03:00
29 lines
592 B
JavaScript
29 lines
592 B
JavaScript
import { version } from '../package.json'
|
|
import createMixin from './shared/mixin'
|
|
import { setOptions } from './shared/options'
|
|
import $meta from './server/$meta'
|
|
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
|
|
}
|