Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
5c273534
提交
5c273534
authored
1月 02, 2021
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(table): restore the property of the table
上级
e821f4c7
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
12 行增加
和
9 行删除
+12
-9
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+7
-9
props.ts
src/components/Table/src/props.ts
+2
-0
table.ts
src/components/Table/src/types/table.ts
+1
-0
TreeTable.vue
src/views/demo/table/TreeTable.vue
+1
-0
没有找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
5c273534
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
### 🐛 Bug Fixes
### 🐛 Bug Fixes
-
修复表格列配置已知问题
-
修复表格列配置已知问题
-
恢复 table 的
`isTreeTable`
属性
## 2.0.0-rc.15 (2020-12-31)
## 2.0.0-rc.15 (2020-12-31)
...
...
src/components/Table/src/hooks/useColumns.ts
浏览文件 @
5c273534
...
@@ -43,19 +43,17 @@ function handleIndexColumn(
...
@@ -43,19 +43,17 @@ function handleIndexColumn(
getPaginationRef
:
ComputedRef
<
boolean
|
PaginationProps
>
,
getPaginationRef
:
ComputedRef
<
boolean
|
PaginationProps
>
,
columns
:
BasicColumn
[]
columns
:
BasicColumn
[]
)
{
)
{
const
{
showIndexColumn
,
indexColumnProps
}
=
unref
(
propsRef
);
const
{
showIndexColumn
,
indexColumnProps
,
isTreeTable
}
=
unref
(
propsRef
);
let
pushIndexColumns
=
false
;
let
pushIndexColumns
=
false
;
columns
.
forEach
((
item
)
=>
{
if
(
unref
(
isTreeTable
))
{
const
{
children
}
=
item
;
return
;
}
const
isTreeTable
=
children
&&
children
.
length
;
columns
.
forEach
(()
=>
{
const
indIndex
=
columns
.
findIndex
((
column
)
=>
column
.
flag
===
INDEX_COLUMN_FLAG
);
const
indIndex
=
columns
.
findIndex
((
column
)
=>
column
.
flag
===
INDEX_COLUMN_FLAG
);
if
(
showIndexColumn
)
{
if
(
showIndexColumn
&&
!
isTreeTable
)
{
pushIndexColumns
=
indIndex
===
-
1
;
pushIndexColumns
=
indIndex
===
-
1
;
}
else
if
(
!
showIndexColumn
&&
!
isTreeTable
&&
indIndex
!==
-
1
)
{
}
else
if
(
!
showIndexColumn
&&
indIndex
!==
-
1
)
{
columns
.
splice
(
indIndex
,
1
);
columns
.
splice
(
indIndex
,
1
);
}
}
});
});
...
...
src/components/Table/src/props.ts
浏览文件 @
5c273534
...
@@ -16,6 +16,8 @@ import { propTypes } from '/@/utils/propTypes';
...
@@ -16,6 +16,8 @@ import { propTypes } from '/@/utils/propTypes';
export
const
basicProps
=
{
export
const
basicProps
=
{
clickToRowSelect
:
propTypes
.
bool
.
def
(
true
),
clickToRowSelect
:
propTypes
.
bool
.
def
(
true
),
isTreeTable
:
propTypes
.
bool
.
def
(
false
),
tableSetting
:
{
tableSetting
:
{
type
:
Object
as
PropType
<
TableSetting
>
,
type
:
Object
as
PropType
<
TableSetting
>
,
},
},
...
...
src/components/Table/src/types/table.ts
浏览文件 @
5c273534
...
@@ -125,6 +125,7 @@ export interface TableSetting {
...
@@ -125,6 +125,7 @@ export interface TableSetting {
export
interface
BasicTableProps
<
T
=
any
>
{
export
interface
BasicTableProps
<
T
=
any
>
{
// 点击行选中
// 点击行选中
clickToRowSelect
?:
boolean
;
clickToRowSelect
?:
boolean
;
isTreeTable
?:
boolean
;
// 自定义排序方法
// 自定义排序方法
sortFn
?:
(
sortInfo
:
SorterResult
)
=>
any
;
sortFn
?:
(
sortInfo
:
SorterResult
)
=>
any
;
// 排序方法
// 排序方法
...
...
src/views/demo/table/TreeTable.vue
浏览文件 @
5c273534
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
:dataSource="data"
:dataSource="data"
rowKey="id"
rowKey="id"
:indentSize="20"
:indentSize="20"
isTreeTable
/>
/>
</div>
</div>
</
template
>
</
template
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论