0.0.8 • Published 4 years ago
vue-table-editable v0.0.8
Vue Editable Table Component
Project Details
Publish a b-table customized editable component vue-table-editable as a NPM module
Module Name: vue-table-editable
Latest version: 0.0.5
####Component main configurations
tableOptions
name feature descriptions value ttAlignTable title alignment leftorcenterttTextTable title text any textcan usettFontsizeTable title font size any number with px(ex:15px)ttColorTable title text color act as css colorproperty`rHoverTable rows hover trueorfalsetBorderTable cells seperate with border trueorfalsethColorTable header background color dark,lightandnonedeleteAlertTitleTable row action confirmation alert message ant text with type stringeditableTable rows edit button show or hide trueorfalsedeletableTable rows delete button show or hide trueorfalsefilterFloatsTable filter align direction left,centerorrightpgAlignTable pagination section alignment left,centerorrightpgPositionTable pagination display position toporbottompgPerPageTable rows per page use a numberwhich more than 1pgSizeTable pagination display size sm,mdorlgimgSizeTable rows loading images size sm,mdorlgitems
- The type of the Data which pass to components should be an
Array
- The type of the Data which pass to components should be an
fields
name feature descriptions value keyTable header map to items any textthat show the items datalabelTable header show name any textcan usetypeTable column data type text,numberandimgsortableTable column want to sort trueorfalsefilterOnColumn data want to filter trueorfalseoutput-change
After edit or delete, a row in table sends an event called
output-change- Return action
savewhen row save after edit Return action
deletewhen row delete success
- Return action
#####How to use editable table component
First add <TableComponent></TableComponent> to vue file
Add props as below
<TableComponent
:items="itemsSet"
:fields="fieldSet"
:tableOptions="tableOptions"
@output-change="handleOutput">
</TableComponent>
Update database when change happened in table rows (Edit or Delete)
handleOutput(action, data) {
if (action === "delete") {
// remove data from database
} else if (action === "save) {
// update data in database
}
}
Test node version: v10.17.0 #####Use only edit button and hide delete button. Table title color change into green

#####Use only edit and delete buttons. Filter and pagination both are in top of the table

#####Edit the row when click the edit button

#####Load images in a table
