el-plus-powerful-table-ts v2.2.16
DEMO
DOCS
语言
对于语言方面组件是默认使用 英语 因为 element-plus 默认是使用英语,不引用中文包的主要原因是避免增大体积。
组件内部语言跟随 element-plus。 部分 提示文字 语言,组件内部也支持 中、英 文,如果你需要支持更多语言或者更改组件内部
的语言,可以在 use(PowerfulTable, { local: 您的语言变量 }) 替换。也可以参考我们提供的 demo 实现。
el-plus-powerful-table-ts
此插件已 el-plus-powerful-table 作为基础,进行重构。部分功能将领先 el-plus-powerful-table 基础版本。
el-plus-powerful-table 的 ts 版本
vue3.0 的 element-plus 二次开发表格组件
简要
- 以下【内部组件】为该文件夹中
packages/components/src下的组件
更新预告
- 3.0.0 版本
- 删除
component-event事件
- 删除
_TYPE类型的key改为枚举
2.2.15 20241114
- 更改类型,在声明
header时,props下属性data属性在不使用setData函数时同样可以获得智能提示。已使用setData不受影响
const header = [{
label: '性别',
props: {
type: 'text',
prop: 'gender',
data: { // 该类型会被推断为 (SetDataType<"input", Lists> & SetDataType<T, Lists>) | undefined
develop: true,
// 输入 l 时会提示 line 属性
},
}
}]2.2.14 20241031
- 修复类型错误
2.2.13 20241028
- 修复已知
bug - 修复类型错误
- 捆绑样式,全局引入情况下无需单独引入样式文件
2.2.10 20241008
- 修复已知
bug
2.2.9 20231205
- 修改暴露的
resetList、getListData函数支持传递参数 - 修复已知
bug
2.2.8 20231205
- 修复
header配置项中props下属性filters的情况下,当前的相应的数据存在值的情况则不会被filters过滤
const list = [{status: 0},{status: 1}]
const header = [{
label: '性别',
props: {
prop:'status',
filters: [
{
text: '男',
value: 1
},
{
text: '女',
value: 0
}
],
}
}]
// [修复]:第二条数据的 status 将不会进行过滤的情况- 修复
type = text时0不会显示
2.2.7 20231204
- 类型补充提示
2.2.6 20231124
PowerfulTableHeaderProps下render函数类型支持返回JSX.Element
2.2.4/5 20231122
"image" | "text" | "switch" | "video" | "input" | "iconfont" | "tag" | "rate" | "textarea"类型中data属性下新增on可选属性
2.2.3 20231119
- 更改
PowerfulTableExpose类型为只读 PowerfulTableExpose类型下添加props、injectProps
- 修复
PowerfulTableExpose 类型下 headerLists 类型为ComputedRef<PowerfulTableHeader<Row>[]>但是实际类型为PowerfulTableHeader<Row>[]。更改后类型为PowerfulTableHeader<Row>[]
- 修复
2.2.2 20231016
- 更改
list-request.responseKey属性默认值'data.data.result'为'data.result' - 更改
list-request.listsKey属性默认值'lists'为'rows'
2.2.1 20231016
BtnList补充click属性- 组件销毁前清除监听事件
2.2.0 20231005
- 新增
type = 'btn'时,添加click属性,需要注意的事,存在click属性时将不会触发beforeClick属性 - 优化了内部组件
button文件中的class由原来的class={item.text ? '' : 'no-margin'}改成空。 - 新增全局组件注入
emptyElement - 新增全局组件注入
listRequest,以及在Props属性上添加。 - 组件添加暴露数据,类型为
PowerfulTableExpose
2.1.15 20230315
- 解决切换批量操作点击确定后选择的批量操作类型永远是第一个
bug component-event自定义事件参数返回更改, 由原来的{ componentName: string, eventType: string }改为{ componentName: string, eventType: string, index: number, prop: PowerfulTableHeaderProps<any>[] | PowerfulTableHeaderProps<any>, row: any }
2.1.14 20230312
- 解决没有类型提示
bug
2.1.13 20230311
2.1.12 20230311
- 取消将
@element-plus/icons添加到es和lib
2.1.11 20230311
- 删除
btnConfig.Config以及InjectProps中btnSlot参数 - 修复
btn-left以及btn-right插槽无效bug
2.1.10 20230223
- 修复鼠标悬浮组件没有类型提示
bug
2.1.9 20230222
2.1.8 20230222
2.1.7 20230222
- 修复
treeProps为undefined问题 - 修复类型为
tag时,数据为undefined报错 type = 'text'data中的customFilterFun属性值更改为formattingPowerfulTableHeaderProps类型上新增属性customFilter自定义过滤
2.1.6 20230221
- 修改自定义过滤头部渲染逻辑
2.1.5 20230216
- 修复未全局安装
element-plus时引发组件不能使用bug - 删除内部组件
input的onClick事件, 因为和onFocus重合 - 删除内部组件
rate的onClick事件,因为ElRate上不存在onClick
2.1.3 20230215
- 修复
lib | es文件夹内.d.ts文件中引入的typings文件路径找不到
2.1.2 20230214
- 更改打包配置
2.1.1 20230130
btn-plus文件重构(vue改成tsx)btnConfig新增属性btnRightList类型为BtnList[]
- 类型
BtnList新增属性tip beforeClick property
- 类型
2.1.0 20230107
- 删除
btn-plus组件中BtnConfig.BtnList的type icon showTip tipContent - 删除 内部组件
data部分属性(由于提供的属性不完整和element-plus存在差异,全部提供则感觉有点冗余,推荐使用property属性。内部组件只会保存部分默认值,但是可以通过property传参替换) image删除lazy zIndex style fit。保留部分默认值fit = 'cover',lazy, preview-teleported = true(el-image中lazy preview-teleported默认false)
input删除type placeholder disabled rows。保留部分默认值rows = 3
href删除type placeholder rows disabled。 保留部分默认值type = 'primary',underline = false
rate删除max colors iconClass allowHalf showText showScore texts property。 保留部分默认值disabled = false
switch删除activeColor inactiveColor inactiveText activeText activeValue inactiveValue disabled isConfirmTip confirmTip beforeFunction保留部分默认值inactiveValue = '0',activeValue = '1'
tag删除closable type effect hit保留部分默认值type = ''
video删除poster loop保留部分默认值controls = true,loop = false
button删除icon disabled type emit isTooltip isConfirmTip confirmTip保留部分默认值type = 'primary'。添加beforeClick tipProperty属性
- 内部组件
property支持函数类型 componentProps属性更改为propertytype类型为video新增property扩展属性BtnConfig.BtnList新增property扩展属性- 内部组件新增自定义事件,详情看
type == 'XX'(XX 为某个类型), 内部组件传递到powerful-table组件由component-event抛出 type = 'text'data中的customFilterFun属性值更改- 修改 组件
InjectProps类型中local的类型。注入的local属性现在主要是用于 替换或者扩展组件内部提示文字 - 优化
button在表格中样式 - 修改
selectable默认不允许勾选问题 header表格头部数据属性中filters更改为defaultFilter.hidden更改为defaultShowprops单元格数据filter更改为filters- 删除 组件
props中的local - 使用
vite进行构建 - 构建库模式优化,生成
es、cjs两种模式
- 构建库模式优化,生成
element-plus版本更新到2.0+2.0.7 20220328
新增 props
propertytype为btn、image、input、rate、switch、tag的data中新增componentProp扩展参数href类型更改为linklink的data中新增属性icon
link的data中text没有值时将显示prop数据在页面上
input类型新增type同el-input type- 修复
rate类型中locale警告 - 优化
link的data中target属性类型固定 - 修复
Failed to resolve component: PTBtnPlus警告
2.0.0 20220314
- 新增支持内置组件导出
PT开头:例如:PTImage,PTButton - 主要用于
powerful-table-draggable组件的引用
- 主要用于
switch、btn类型新增属性isConfirmTip是否开启点击时确认框提示
isConfirmTip确认框提示文字
- 优化
el-pagination small属性随组件或全局size属性更改 - 解决鼠标悬浮在组件上没有类型
1.1.0 20211231
- 新增表格顶部按钮功能
- 新增配置项 传送门
- 新增插槽
btn-leftbtn-right
- 新增插槽
header新增属性isShowOrFilterColumn是否开启过滤或者显示隐藏列的开关
selectable行是否可以选中
prop新增属性filtersType过滤类型
filterItem指定过滤项
1.0.6 20211226
- 解决数据选中
bug - 优化部分样式问题
- 优化
props类型从数组 改为 数组或者对象均可 - 按钮配置优化
- 可配置二维数组
- 删除
emit
- 删除
- 新增
isTooltip是否显示提示
- 新增
- 新增
params,isMore属性。params自定义传入数据,将会在点击按钮时返回。例如:
- 新增
{
{
;('update')
}
}
// index.vue
;<powerfulTable v-on:btnClick="handleOperate"></powerfulTable>
// row 当前行数据 params 自定义传入的数据 index 当前行的下标
const handleOperate = ({ row, params, index }) => ({})isMore 用来判断是否将当前对象数据 显示为 更多按钮
{
;[
{
type: 'btn',
prop: 'btn',
data: [
{
tip: '编辑',
type: 'info',
icon: markRaw(Edit),
text: '编辑',
// showBtn: false,
// isTooltip: true,
params: {
emit: 'update',
},
},
[
{
tip: '更多',
isMore: true,
type: 'success',
icon: markRaw(Edit),
},
{
tip: '编辑',
type: 'text',
icon: markRaw(Edit),
params: 'update',
},
{
tip: '更多a',
isMore: true, // 这个将不会被引用到
type: 'success',
icon: markRaw(Edit),
},
{
tip: '删除',
type: 'text',
icon: markRaw(Delete),
params: 'remove',
},
],
{
tip: '删除',
type: 'danger',
icon: markRaw(Delete),
showBtn: (e: any) => {
return true
},
params: {
emit: 'remove',
},
},
],
},
]
}- 删除
child字段 - 新增全局组件注入
locale和size
Git 贡献提交规范
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago