0.0.8 • Published 3 years ago

vue-table-editable v0.0.8

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

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

    namefeature descriptionsvalue
    ttAlignTable title alignmentleft or center
    ttTextTable title textany text can use
    ttFontsizeTable title font sizeany number with px (ex:15px)
    ttColorTable title text coloract as css color property`
    rHoverTable rows hovertrue or false
    tBorderTable cells seperate with bordertrue or false
    thColorTable header background colordark,light and none
    deleteAlertTitleTable row action confirmation alert messageant text with type string
    editableTable rows edit button show or hidetrue or false
    deletableTable rows delete button show or hidetrue or false
    filterFloatsTable filter align directionleft, center or right
    pgAlignTable pagination section alignmentleft, center or right
    pgPositionTable pagination display positiontop or bottom
    pgPerPageTable rows per pageuse a number which more than 1
    pgSizeTable pagination display sizesm,md or lg
    imgSizeTable rows loading images sizesm,md or lg
  • items

    • The type of the Data which pass to components should be an Array
  • fields

    namefeature descriptionsvalue
    keyTable header map to itemsany text that show the items data
    labelTable header show nameany text can use
    typeTable column data typetext,number and img
    sortableTable column want to sorttrue or false
    filterOnColumn data want to filtertrue or false
  • output-change

    After edit or delete, a row in table sends an event called output-change

    • Return action save when row save after edit
    • Return action delete when row delete success

#####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 Image of Yaktocat

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

#####Edit the row when click the edit button Image of Yaktocat

#####Load images in a table Image of Yaktocat

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago