diff --git a/.gitignore b/.gitignore index b20d32f..43ad9c1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ docs/.vuepress/dist /tests/e2e/videos/ /tests/e2e/screenshots/ - +vue-tabulator-v*.tgz # local env files .env.local .env.*.local diff --git a/src/App.vue b/src/App.vue index 9a17ccc..6874aae 100644 --- a/src/App.vue +++ b/src/App.vue @@ -39,7 +39,7 @@ - - - diff --git a/src/entry.ts b/src/entry.ts index 5109f4d..5257795 100644 --- a/src/entry.ts +++ b/src/entry.ts @@ -1,10 +1,11 @@ import Vue from 'vue'; -import VueTabulator from '@/components/VueTabulator.vue'; +import TabulatorComponent from '@/components/TabulatorComponent.vue'; -export { VueTabulator }; +export { TabulatorComponent }; export default { - install(VueApp: typeof Vue) { - VueApp.component('VueTabulator', VueTabulator); + install(VueApp: typeof Vue, options: any = {}) { + const name = options.name || 'VueTabulator'; + VueApp.component(name, TabulatorComponent); }, }; diff --git a/tests/unit/__snapshots__/vue-tabulator.spec.ts.snap b/tests/unit/__snapshots__/vue-tabulator.spec.ts.snap index b7f97b5..5b46c70 100644 --- a/tests/unit/__snapshots__/vue-tabulator.spec.ts.snap +++ b/tests/unit/__snapshots__/vue-tabulator.spec.ts.snap @@ -1,9 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`VueTabulator.vue renders correct based in the options 1`] = ` +exports[`TabulatorComponent.vue renders correct based in the options 1`] = `
-
-
+
+
Name
diff --git a/tests/unit/vue-tabulator.spec.ts b/tests/unit/vue-tabulator.spec.ts index 19f51f6..debbc7d 100644 --- a/tests/unit/vue-tabulator.spec.ts +++ b/tests/unit/vue-tabulator.spec.ts @@ -1,8 +1,8 @@ import { shallowMount } from '@vue/test-utils'; -import VueTabulator from '@/components/VueTabulator.vue'; +import TabulatorComponent from '@/components/TabulatorComponent.vue'; import Vue from 'vue'; -describe('VueTabulator.vue', () => { +describe('TabulatorComponent.vue', () => { it('renders correct based in the options', () => { const options = { columns: [ @@ -16,7 +16,7 @@ describe('VueTabulator.vue', () => { ], }; - const wrapper = shallowMount(VueTabulator, { + const wrapper = shallowMount(TabulatorComponent, { propsData: { options, }, diff --git a/vue.config.js b/vue.config.js index 0d142bd..2a09357 100644 --- a/vue.config.js +++ b/vue.config.js @@ -17,9 +17,6 @@ module.exports = { }); }, configureWebpack: { - output: { - libraryExport: 'default', - }, plugins: [new CopyWebpackPlugin([{ from: 'src/scss', to: 'scss' }])], }, };