2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-24 22:30:34 +03:00

Revert "feat: use named exports to export helper functions"

This reverts commit 95c3b7d4e8.
This commit is contained in:
pimlie
2019-03-05 14:12:56 +01:00
parent 95c3b7d4e8
commit f597f61104
4 changed files with 13 additions and 16 deletions
+5 -6
View File
@@ -9,7 +9,7 @@ export { hasMetaInfo } from './shared/hasMetaInfo'
* Plugin install function. * Plugin install function.
* @param {Function} Vue - the Vue constructor. * @param {Function} Vue - the Vue constructor.
*/ */
function install(Vue, options = {}) { function VueMeta(Vue, options = {}) {
options = setOptions(options) options = setOptions(options)
Vue.prototype.$meta = $meta(options) Vue.prototype.$meta = $meta(options)
@@ -17,13 +17,12 @@ function install(Vue, options = {}) {
Vue.mixin(createMixin(Vue, options)) Vue.mixin(createMixin(Vue, options))
} }
VueMeta.version = version
// automatic install // automatic install
if (!isUndefined(window) && !isUndefined(window.Vue)) { if (!isUndefined(window) && !isUndefined(window.Vue)) {
/* istanbul ignore next */ /* istanbul ignore next */
install(window.Vue) Vue.use(VueMeta)
} }
export { export default VueMeta
version,
install
}
+4 -5
View File
@@ -8,7 +8,7 @@ export { hasMetaInfo } from './shared/hasMetaInfo'
* Plugin install function. * Plugin install function.
* @param {Function} Vue - the Vue constructor. * @param {Function} Vue - the Vue constructor.
*/ */
function install(Vue, options = {}) { function VueMeta(Vue, options = {}) {
options = setOptions(options) options = setOptions(options)
Vue.prototype.$meta = $meta(options) Vue.prototype.$meta = $meta(options)
@@ -16,7 +16,6 @@ function install(Vue, options = {}) {
Vue.mixin(createMixin(Vue, options)) Vue.mixin(createMixin(Vue, options))
} }
export { VueMeta.version = version
version,
install export default VueMeta
}
+1 -3
View File
@@ -1,6 +1,4 @@
import { mount, defaultOptions, VueMetaServerPlugin, loadVueMetaPlugin } from './utils' import { mount, defaultOptions, hasMetaInfo, VueMetaServerPlugin, loadVueMetaPlugin } from './utils'
const { hasMetaInfo } = VueMetaServerPlugin
jest.mock('../package.json', () => ({ jest.mock('../package.json', () => ({
version: 'test-version' version: 'test-version'
+3 -2
View File
@@ -1,7 +1,7 @@
import { mount, createLocalVue } from '@vue/test-utils' import { mount, createLocalVue } from '@vue/test-utils'
import { renderToString } from '@vue/server-test-utils' import { renderToString } from '@vue/server-test-utils'
import * as VueMetaBrowserPlugin from '../../src/browser' import VueMetaBrowserPlugin from '../../src/browser'
import * as VueMetaServerPlugin from '../../src' import VueMetaServerPlugin, { hasMetaInfo } from '../../src'
import { import {
keyName, keyName,
@@ -15,6 +15,7 @@ import {
export { export {
mount, mount,
renderToString, renderToString,
hasMetaInfo,
VueMetaBrowserPlugin, VueMetaBrowserPlugin,
VueMetaServerPlugin VueMetaServerPlugin
} }