npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dbs-table

v1.1.6

Published

<!-- * @Author: luyao * @Date: 2023-08-02 14:03:09 * @LastEditTime: 2023-08-04 16:13:42 * @Description: * @LastEditors: luyao * @FilePath: /dbs-table/README.md -->

Downloads

20

Readme

dbs-table

基于 vue3+elementPlus 二次开发的表格(实际项目中用了两年半了)

环境

vue3 、 elementPlus

使用说明

// 安装依赖
npm i dbs-table  -D

// main.js 引入

import dbsTable from "dbs-table";

let app = createApp(App);
app.use(dbsTable);
app.mount("#app");



<script setup lang="ts">
const tableData = [
  {
    date: "2016-05-03",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-02",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-04",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-01",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
];

let columns = [
  {
    title: "date",
    key: "date",
    minWidth: 80,
  },
  {
    title: "name",
    key: "name",
    minWidth: 80,
  },
  {
    title: "address",
    key: "address",
    minWidth: 80,
  },
];
</script>

<template>
  <dbsTable :data="tableData" :columns="columns" />
</template>

组件名称

Props

| Prop 名称 | 类型 | 默认值 | 说明 | | ---------------------- | --------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------- | | tableName | String | | 表格名称 | | columns | Array | [] | 表头数据,包含文案、绑定值和特殊处理的 slot | | data | Array | [] | 数据 | | totalNum | Number | 0 | 总条数 | | pageNum | Number | 1 | 当前页 | | pageSize | Number | 20 | 每页数量 | | loading | Boolean | | 是否开启 loading | | configFlag | Object | { needPage: true, selection: false, index: false, border: true, tableAlign: 'left', indexName: null } | 其他 table 配置 | | needPage | Boolean | true | 是否需要分页 | | needIndex | Boolean | false | 是否需要 index | | autoHeight | Boolean | false | 是否需要自适应屏幕高度 | | tableHeight | String | | 表格高度 | | tableMaxHeight | String | | 表格最大高度 | | headerCellStyle | Object | { color: 'white', backgroundColor: '#999' } | header 头部单元格样式 | | cellStyle | Function/Object | { color: '', backgroundColor: '' } | body 单元格样式 | | highlightCurrentRow | Boolean | true | 行是否高亮 | | selecTableFun | Function | () => true | 选中函数 | | objectSpanMethod | Function | () => true | 单元格点击函数 | | key | String | | key 字段 | | rowKey | String | | 行 key 字段 | | tableRowClassName | Function | | table class | | dragRow | Boolean | false | 是否开启拖拽行为 | | cusClass | String | | 自定义行 class | | dragBtn | String | | 拖拽句柄 | | excludeDownloadColumns | Array | ['', '操作', '图片'] | 前端下载表格时需要过滤掉的列 |