1 Star 0 Fork 2

冬日阳光 / pure-admin-table

forked from zym / pure-admin-table 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

@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 © 2022-present, pure-admin

MIT License Copyright (c) 2022-present, pure-admin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

使用tsx语法二次封装element-plus的Table,提供灵活的配置项 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/kcly3027/pure-admin-table.git
git@gitee.com:kcly3027/pure-admin-table.git
kcly3027
pure-admin-table
pure-admin-table
main

搜索帮助