VueJs Spreadsheet
An easier Spreadsheet in Vue.js
Do not hesitate to :star: my repo
Project setup
yarn add vuejs-spreadsheet
npm i vuejs-spreadsheet
<script>
import VueTable from 'vuejs-spreadsheet';
export default {
name: 'app',
data() {
},
components: {
VueTable,
},
};
</script>
Wiki :mortar_board:
Props | Type | Description |
---|---|---|
:tbody-data | Array | That contains data |
:headers | Array | That contains headers |
:custom-options | Object | That contains Options |
:style-wrap-vue-table | Object | That contains style of the wrapper tableVue |
:disable-cells | Array | That contains the headerKey you want to disable |
:disable-sort-thead | Array | That contains the disabled th |
:loading | Boolean | True => Hidden TbodyData / show slot loader |
:parent-scroll-element | Object | That contains the HTML attribute which overflow-y: scroll (by-default is 'html') |
.... | | That contains a top and left position you want to add to the select
:select-position | Object | That contains a top and left position you want to add to the select
:submenu-tbody | Array | That contains the submenu-tbody
:submenu-thead | Array | That contains the submenu-thead
Options | Type | Description |
---|---|---|
:fuse-options | Object | That contains an object of fuse configuration look on her website: http://fusejs.io/ |
:new-data | Object | That contains the type of data when you have empty cell in a row |
:sort-header | Boolean | That activates sort button on header |
:tbody-index | Boolean | That displays the index of each row on the left of the table |
:trad | Object | That contains an object of translating |
Function | Type | Description |
---|---|---|
v-on:tbody-change-data | Function | Fired when data undergo modifications |
v-on:tbody-input-change | Function | When the input changes |
v-on:tbody-select-change | Function | When the select change |
v-on:handle-up-drag-size-header | Function | Fired when the header size changed |
v-on:thead-td-sort | Function | When you press the button sort |
v-on:tbody-up-dragtofill | Function | Fired when pressed up on dragToFill |
v-on:tbody-move-dragtofill | Function | Fired when moved on dragToFill |
v-on:tbody-nav-backspace | Function | When you press backspace on cell (event, actualElement, actualCol, rowIndex, colIndex) |
v-on:tbody-nav-multiple-backspace | Function | Fired when the multiple cell are delete |
v-on:tbody-submenu-click-{#} | Function | {#} - Name of the function declared on submenu-tbody |
Example
Options :honeybee:
customOptions: {
dragToFill: true,
tbodyIndex: true,
sortHeader: true,
trad: {
lang: 'fr',
en: {
select: {
placeholder: 'Search by typing',
},
},
fr: {
select: {
placeholder: 'Taper pour chercher',
},
},
},
newData: {
type: 'input',
value: '',
active: false,
style: {
color: '#000',
},
},
fuseOptions: {
shouldSort: true,
threshold: 0.2,
location: 0,
distance: 30,
maxPatternLength: 64,
minMatchCharLength: 1,
findAllMatches: false,
tokenize: false,
keys: [
'value',
],
},
},
Headers :tiger:
Name | Type | Description |
---|---|---|
headerName | String | The chosen header name |
headerkey | String | The Slugify version of the headerName |
style | Object | The style of the td |
- width | String | Indicate the width of ``<th>``
- minWidth | String | minWidth must be equal to width
disabled | Boolean | optional - Disabled cell
Example
Data :honeybee:
Name | Type | Description |
---|---|---|
key | String | The key of the object written in Slugify |
type | String | The type of data rendered (<textarea> , <img> , <select> ) |
value(img/input) | String | The value of the object in String Type |
value(select) | Array | The value of the object in Array Type |
selectOptions | Array | That contains objects {value: ~, label: ~} |
style | Object | The Style of the cell |
active | Boolean | Of the cell, false by default |
handleSearch | Boolean | - Activates search when selected |
disabled | Boolean | optional - Disabled cell |
Example
New Data :tiger:
Example
Same Object describe on the top
If you choose an input
newData: {
type: 'input',
value: '',
active: false,
style: {
color: '#000',
background: '#cfffcf',
},
},
submenu :monkey_face:
Name | Type | Description |
---|---|---|
type | String | The type of data rendered (<button> |
value | String | The value of the function |
function | String | The name of the function called when you click on the button - Written in Slugify |
disabled | Array | Each object which you want to hide on the submenu |
subtitle | String | Of the select |
selectOptions | Array | That contains objects {value: ~, label: ~} |
buttonOption | Object | Description |
. value | String | The value of the button |
. function | String | The name of the function called when you click on the button - Written in Slugify |
. style | Object | The style of the button |