Skip to content

Commit

Permalink
update options to configure
Browse files Browse the repository at this point in the history
  • Loading branch information
angeliski committed May 8, 2019
1 parent 4a9c74d commit ac3d42d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ docs/.vuepress/dist

/tests/e2e/videos/
/tests/e2e/screenshots/

vue-tabulator-v*.tgz
# local env files
.env.local
.env.*.local
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import VueTabulator from './components/VueTabulator.vue';
import VueTabulator from './components/TabulatorComponent.vue';
@Component({
components: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {
import Tabulator from 'tabulator-tables';
@Component({
name: 'VueTabulator',
name: 'TabulatorComponent',
})
export default class VueTabulator extends Vue {
export default class TabulatorComponent extends Vue {
@Model('change', { default: () => [] })
public tableData?: Array<any>;
Expand Down Expand Up @@ -55,7 +55,3 @@ export default class VueTabulator extends Vue {
}
}
</script>


<style lang='scss'>
</style>
9 changes: 5 additions & 4 deletions src/entry.ts
Original file line number Diff line number Diff line change
@@ -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);
},
};
6 changes: 3 additions & 3 deletions tests/unit/__snapshots__/vue-tabulator.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -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`] = `
<div class="tabulator" role="grid" tabulator-layout="fitData">
<div class="tabulator-header">
<div class="tabulator-headers">
<div class="tabulator-header" style="padding-right: 0px;">
<div class="tabulator-headers" style="margin-left: 0px;">
<div class="tabulator-col tabulator-sortable" role="columnheader" aria-sort="none" tabulator-field="name" style="min-width: 40px; width: 200px;" title="">
<div class="tabulator-col-content">
<div class="tabulator-col-title">Name</div>
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/vue-tabulator.spec.ts
Original file line number Diff line number Diff line change
@@ -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: [
Expand All @@ -16,7 +16,7 @@ describe('VueTabulator.vue', () => {
],
};

const wrapper = shallowMount(VueTabulator, {
const wrapper = shallowMount(TabulatorComponent, {
propsData: {
options,
},
Expand Down
3 changes: 0 additions & 3 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ module.exports = {
});
},
configureWebpack: {
output: {
libraryExport: 'default',
},
plugins: [new CopyWebpackPlugin([{ from: 'src/scss', to: 'scss' }])],
},
};

0 comments on commit ac3d42d

Please sign in to comment.