Giter VIP home page Giter VIP logo

pure-admin-table's Introduction

@pureadmin/table

二次封装element-plus的Table,提供灵活的配置项

NPM version NPM Downloads

简体中文 | English

预览地址
更多示例

🤔 开发初衷

element-plus TableTable-column属性目前只能写在<template></template>模版里,这样不是很灵活,如果表格的column足够多,代码写、看起来很臃肿,但element-plus Virtualized Table 可配置性就很高,为了保持统一,我将Table二次封装并沿用了cellRendererheaderRenderer这两个自定义 renderer,内置了可通过配置渲染的分页组件,当然还有一些额外的属性,让我们一起探索吧

🚀 特性

🦾 灵活度高: 使用tsx语法编写,保证类型的同时,给开发者提供了更灵活的写法,给使用者提供了更方便的配置
完全可摇树: 自带 Tree-shaking,只对引入的代码进行打包
🫶 代码零侵入: 保持element-plus Table 的所有属性、插槽、事件、方法的同时,提供更灵活的配置,而且还内置了可通过配置渲染的分页组件
代码提交前校验: 使用 husky 对提交代码前进行规则校验,强制规范开发流程,防止开发失误

📦 安装

npm install @pureadmin/table
or
pnpm add @pureadmin/table

🕸️ CDN

<script src="https://unpkg.com/@pureadmin/table"></script>
or
<script src="https://cdn.jsdelivr.net/npm/@pureadmin/table"></script>

🦄 用法

局部注册(单文件)

import { PureTable } from "@pureadmin/table";

<pure-table :data="dataList" :columns="columns" :pagination="pagination"></pure-table>

全局注册(main.ts)

import { createApp } from "vue";
import App from "./App.vue";

import Table from "@pureadmin/table";

const app = createApp(App);

app.use(Table).mount("#app");

点击查看按需、全局以及 Html 文件引入的用法

Volar 支持

如果您在使用 Volar,那么可以在 tsconfig.json 中配置 compilerOptions.types 来指定全局组件类型(尤其是全局注册时要想获得类型提示就需要加上下面配置)

// tsconfig.json
{
  "compilerOptions": {
    // ...
    "types": ["@pureadmin/table/volar"]
  }
}

许可证

MIT © xiaoxian521-latest

pure-admin-table's People

Contributors

xiaoxian521 avatar ten-k 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.