Giter VIP home page Giter VIP logo

vue3-datatable's Introduction

DataTable - Vue3 Component

Basic DataTable component for Vue3 in typescript and Composition API. It has basic functionality such as Filter/Search, pagination etc.

NPM JavaScript Style Guide Build

DataTable Demo

Install

npm install --save @jobinsjp/vue3-datatable

or,

yarn add @jobinsjp/vue3-datatable

Usage

    <data-table :rows="data"/>

Properties

In addition to basic use it you can configure data-table behaviour by applying following properties and template slots.

Striped

striped property

    <data-table :rows="data" striped/>

Custom Loader

loading property

loadData event

<template>
    <data-table ...
                :loading="isLoading"
                @loadData="loadData">
        <template #loading>
            <div class="">Loading....</div>
        </template>
    </data-table>
</template>


setup() {
    // ...

    const isLoading = ref(false)
    const loadData = async (query) => {
        isLoading.value = true
        // ...
        isLoading.value = false
    }

    return {
        isLoading,
        loadData,
        // ...
        }
}

Clickable Row

rowClicked event

<template>
    <data-table ...
                @rowClicked="rowClickHandler">
    </data-table>
</template>

setup() {
    // ...

    const rowClickHandler = (row) => {
        console.log("Row Clicked", row)
    }

Empty Table

empty slot

import { TableBodyCell } from "@jobinsjp/vue3-datatable"

   <data-table :rows="[]">
        <template #empty>
            <TableBodyCell colspan="2">
                No record found.
            </TableBodyCell>
        </template>
    </data-table>

Custom Row & Column, Paginated, Filter

Documentation, in todo, see code example here: https://github.com/JoBinsJP/vue3-datatable/tree/master/src/components/Tables

License

MIT © https://github.com/JoBinsJP/vue3-datatable

vue3-datatable's People

Contributors

puncoz avatar kushalraj avatar shershen08 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.