Git Product home page Git Product logo

grid-js-component-vue's Introduction

Dependency Status devDependency Status Build Status npm version Downloads

grid-js-component

A reactjs and vuejs grid component.

install

npm i grid-js-component

link css

<link rel="stylesheet" href="./node_modules/grid-js-component/dist/grid.min.css" />

module bundler

This component should work with webpack, and it requires npm install raw-loader --save-dev to load templates.

vuejs component demo

npm i vue vue-class-component

import "grid-js-component/dist/vue";
<grid :data="data">
</grid>

the online demo: https://plantain-00.github.io/grid-js-component/demo/vue/index.html

the source code of the demo: https://github.com/plantain-00/grid-js-component/tree/master/demo/vue

reactjs component demo

import { Grid } from "grid-js-component/dist/react";
<Grid data={data} />

the online demo: https://plantain-00.github.io/grid-js-component/demo/react/index.html

the source code of the demo: https://github.com/plantain-00/grid-js-component/tree/master/demo/react

properties and events of the component

name type description
data GridData the data of the tree

grid data structure

type GridData = {
    headers: GridRowData;
    rows: GridRowData[];
    leftHeaders?: GridRowData;
    leftRows?: GridRowData[];
    rightHeaders?: GridRowData;
    rightRows?: GridRowData[];
};

type GridRowData = {
    cells: GridCellData[];
    style?: string; // the class string of the row, used to set style
};

type GridCellData = {
    value: any; // the value in the cell
    component?: string | Function; //  if exists, show the component rather than the value in the cell
    style?: string; // the class string of the cell, used to set style
};

general styles

  • grid
  • grid-main
  • grid-main-head
  • grid-main-head-row
  • grid-main-head-row-cell
  • grid-main-body
  • grid-main-body-row
  • grid-main-body-row-cell
  • grid-left
  • grid-left-head
  • grid-left-head-row
  • grid-left-head-row-cell
  • grid-left-body
  • grid-left-body-row
  • grid-left-body-row-cell
  • grid-right
  • grid-right-head
  • grid-right-head-row
  • grid-right-head-row-cell
  • grid-right-body
  • grid-right-body-row
  • grid-right-body-row-cell

features

  • vuejs component
  • reactjs component
  • scrollbar
  • custom cell component
  • freeze columns

changelogs

v2
// v1
+ grid
+ grid-head
+ grid-head-row
+ grid-head-row-cell
+ grid-body
+ grid-body-row
+ grid-body-row-cell

// v2
+ grid-main
+ grid-main-head
+ grid-main-head-row
+ grid-main-head-row-cell
+ grid-main-body
+ grid-main-body-row
+ grid-main-body-row-cell

grid-js-component-vue's People

Contributors

plantain-00 avatar

Watchers

 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.