nkgj-vue-table

1.7.9 • Public • Published

npm vue2 NPM downloads codecov license Discord Gitter

介绍

一个基于 Vue2.x 的表格组件

API & 文档

功能支持

基础组件

Table 组件

安装

npm install nkgj-vue-table

or

yarn add nkgj-vue-table

使用

Write the following in main.js:

import Vue from "vue";
import "nkgj-vue-table/libs/theme-default/index.css";
import VueNkTable from "nkgj-vue-table";

Vue.use(VueNkTable);

new Vue({
  el: "#app",
  render: (h) => h(App),
});

Example:

<template>
  <nk-table :columns="columns" :table-data="tableData" />
</template>

<script>
  export default {
    data() {
      return {
        columns: [
          { field: "name", key: "a", title: "Name", align: "center" },
          { field: "date", key: "b", title: "Date", align: "left" },
          { field: "hobby", key: "c", title: "Hobby", align: "right" },
          { field: "address", key: "d", title: "Address" },
        ],
        tableData: [
          {
            name: "John",
            date: "1900-05-20",
            hobby: "coding and coding repeat",
            address: "No.1 Century Avenue, Shanghai",
          },
          {
            name: "Dickerson",
            date: "1910-06-20",
            hobby: "coding and coding repeat",
            address: "No.1 Century Avenue, Beijing",
          },
          {
            name: "Larsen",
            date: "2000-07-20",
            hobby: "coding and coding repeat",
            address: "No.1 Century Avenue, Chongqing",
          },
          {
            name: "Geneva",
            date: "2010-08-20",
            hobby: "coding and coding repeat",
            address: "No.1 Century Avenue, Xiamen",
          },
          {
            name: "Jami",
            date: "2020-09-20",
            hobby: "coding and coding repeat",
            address: "No.1 Century Avenue, Shenzhen",
          },
        ],
      };
    },
  };
</script>

支持环境

  • 现代浏览器和 IE11 及以上
IE / EdgeIE / Edge FirefoxFirefox ChromeChrome SafariSafari OperaOpera
IE11, Edge last 2 versions last 2 versions last 2 versions last 2 versions

Package Sidebar

Install

npm i nkgj-vue-table

Weekly Downloads

5

Version

1.7.9

License

MIT

Unpacked Size

1.66 MB

Total Files

197

Last publish

Collaborators

  • cxjmark