Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
啊嘞嘞EC
vue-vben-admin
提交
2875a97b
V
vue-vben-admin
项目概览
啊嘞嘞EC
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2875a97b
编写于
9月 17, 2021
作者:
无
无木
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(table): `clickToRowSelect` support `disabled` checkbox
修复`clickToRowSelect`会无视行选择框disabled状态的问题
上级
067753d4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
1 deletion
+20
-1
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
src/components/Table/src/hooks/useCustomRow.ts
src/components/Table/src/hooks/useCustomRow.ts
+8
-0
src/views/demo/table/TreeTable.vue
src/views/demo/table/TreeTable.vue
+11
-1
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
2875a97b
...
...
@@ -8,6 +8,7 @@
-
修复可编辑单元格某些情况下无法提交的问题
-
修复
`inset`
属性不起作用的问题
-
修复
`useTable`
与
`BasicTable`
实例的
`reload`
方法
`await`
表现不一致的问题
-
修复
`clickToRowSelect`
会无视行选择框 disabled 状态的问题
-
**BasicModal**
-
修复点击遮罩、按下
`Esc`
键都不能关闭
`Modal`
的问题
-
修复点击关闭按钮、最大化按钮旁边的空白区域也会导致
`Modal`
关闭的问题
...
...
src/components/Table/src/hooks/useCustomRow.ts
浏览文件 @
2875a97b
...
...
@@ -46,6 +46,14 @@ export function useCustomRow(
const
isCheckbox
=
rowSelection
.
type
===
'
checkbox
'
;
if
(
isCheckbox
)
{
// 找到tr
const
tr
:
HTMLElement
=
(
e
as
MouseEvent
)
.
composedPath
?.()
.
find
((
dom
:
HTMLElement
)
=>
dom
.
tagName
===
'
TR
'
)
as
HTMLElement
;
if
(
!
tr
)
return
;
// 找到Checkbox,检查是否为disabled
const
checkBox
=
tr
.
querySelector
(
'
input[type=checkbox]
'
);
if
(
!
checkBox
||
checkBox
.
hasAttribute
(
'
disabled
'
))
return
;
if
(
!
keys
.
includes
(
key
))
{
setSelectedRowKeys
([...
keys
,
key
]);
return
;
...
...
src/views/demo/table/TreeTable.vue
浏览文件 @
2875a97b
...
...
@@ -19,7 +19,17 @@
const
[
register
,
{
expandAll
,
collapseAll
}]
=
useTable
({
title
:
'
树形表格
'
,
isTreeTable
:
true
,
rowSelection
:
{
type
:
'
checkbox
'
},
rowSelection
:
{
type
:
'
checkbox
'
,
getCheckboxProps
(
record
:
Recordable
)
{
// Demo: 第一行(id为0)的选择框禁用
if
(
record
.
id
===
'
0
'
)
{
return
{
disabled
:
true
};
}
else
{
return
{
disabled
:
false
};
}
},
},
titleHelpMessage
:
'
树形组件不能和序列号列同时存在
'
,
columns
:
getBasicColumns
(),
dataSource
:
getTreeTableData
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录