🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

dynamic-table-render

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

dynamic-table-render

基于elementui动态表格支持分页

0.1.6
unpublished
latest
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

动态表格 (基于element-ui)

=================

  npm i dynamic-table-render

使用

import dynamicTableRender  from 'dynamic-table-render'
import ElementUI from 'element-ui'
Vue.use(ElementUI)
Vue.use(dynamicTableRender)

参数说明

columns: 表头配置
data:数据列 
showPagination: 是否展示分页
pagination: 同el-pagination配置
其他参数配置同 el-table配置

实例

 data: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄",
        },
      ],
      pagination: {
        total: 10,
        page: 1,
        size: 5,
        layout: "total, sizes, prev, pager, next, jumper",
      },
      columns: [
        {
          prop: "index",
          label: "序号",
          align: "center",
          width: "60",
          formatter: (row, column, cellValue, index) => {
            const _this = this;
            return (
              (_this.pagination.page - 1) * _this.pagination.size + index + 1
            );
          },
        },
        {
          prop: "date",
          label: "日期",
          width: "120",
          align: "center",
        },
        {
          prop: "name",
          label: "名字",
          width: "160",
          align: "center",
        },
        {
          prop: "address",
          label: "地址",
          align: "center",
        },
        {
          label: "操作",
          align: "center",
          fixed: "right",
          width: "220",
          render: (h, { row }) => {
            const props = {
              type: "primary",
              size: "mini",
            };
            return h("div", [
              h(
                "el-button",
                {
                  props: props,
                  on: {
                    click: () => {
                      console.log(row);
                    },
                  },
                },
                "编辑"
              ),
              h(
                "el-button",
                {
                  props: props,
                },
                "删除"
              ),
            ]);
          },
        },
      ],

Keywords

table

FAQs

Package last updated on 13 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts