Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
啊嘞嘞EC
vue-vben-admin
提交
af55511b
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,发现更多精彩内容 >>
提交
af55511b
编写于
1月 02, 2021
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(table): table columns setting error
上级
aa596af6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
12 deletion
+32
-12
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+4
-0
src/components/Table/src/hooks/useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+17
-6
src/components/Table/src/hooks/useTable.ts
src/components/Table/src/hooks/useTable.ts
+11
-6
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
af55511b
...
...
@@ -4,6 +4,10 @@
-
新增
`mixSideTrigger`
配置。用于配置左侧混合模式菜单打开方式。可选
`hover`
,默认
`click`
### 🐛 Bug Fixes
-
修复表格列配置已知问题
## 2.0.0-rc.15 (2020-12-31)
### ✨ 表格破坏性更新
...
...
src/components/Table/src/hooks/useColumns.ts
浏览文件 @
af55511b
import
type
{
BasicColumn
,
BasicTableProps
,
CellFormat
,
GetColumnsParams
}
from
'
../types/table
'
;
import
type
{
PaginationProps
}
from
'
../types/pagination
'
;
import
{
unref
,
ComputedRef
,
Ref
,
computed
,
watch
Effect
,
ref
,
toRaw
}
from
'
vue
'
;
import
{
unref
,
ComputedRef
,
Ref
,
computed
,
watch
,
ref
,
toRaw
}
from
'
vue
'
;
import
{
isBoolean
,
isArray
,
isString
,
isObject
}
from
'
/@/utils/is
'
;
import
{
DEFAULT_ALIGN
,
PAGE_SIZE
,
INDEX_COLUMN_FLAG
,
ACTION_COLUMN_FLAG
}
from
'
../const
'
;
import
{
useI18n
}
from
'
/@/hooks/web/useI18n
'
;
...
...
@@ -156,11 +156,22 @@ export function useColumns(
return
viewColumns
;
});
watchEffect
(()
=>
{
const
columns
=
toRaw
(
unref
(
propsRef
).
columns
);
columnsRef
.
value
=
columns
;
cacheColumns
=
columns
?.
filter
((
item
)
=>
!
item
.
flag
)
??
[];
});
watch
(
()
=>
unref
(
propsRef
).
columns
,
(
columns
)
=>
{
columnsRef
.
value
=
columns
;
cacheColumns
=
columns
?.
filter
((
item
)
=>
!
item
.
flag
)
??
[];
}
);
// watchEffect(() => {
// const columns = toRaw(unref(propsRef).columns);
// console.log('======================');
// console.log(111);
// console.log('======================');
// columnsRef.value = columns;
// cacheColumns = columns?.filter((item) => !item.flag) ?? [];
// });
/**
* set columns
...
...
src/components/Table/src/hooks/useTable.ts
浏览文件 @
af55511b
...
...
@@ -3,11 +3,10 @@ import type { PaginationProps } from '../types/pagination';
import
type
{
DynamicProps
}
from
'
/@/types/utils
'
;
import
{
getDynamicProps
}
from
'
/@/utils
'
;
import
{
ref
,
onUnmounted
,
unref
}
from
'
vue
'
;
import
{
ref
,
onUnmounted
,
unref
,
watch
}
from
'
vue
'
;
import
{
isProdMode
}
from
'
/@/utils/env
'
;
import
{
isInSetup
}
from
'
/@/utils/helper/vueHelper
'
;
import
{
error
}
from
'
/@/utils/log
'
;
import
{
watchEffect
}
from
'
vue
'
;
import
type
{
FormActionType
}
from
'
/@/components/Form
'
;
type
Props
=
Partial
<
DynamicProps
<
BasicTableProps
>>
;
...
...
@@ -33,12 +32,18 @@ export function useTable(
}
tableRef
.
value
=
instance
;
formRef
.
value
=
formInstance
;
// tableProps && instance.setProps(tableProps
);
tableProps
&&
instance
.
setProps
(
getDynamicProps
(
tableProps
)
);
loadedRef
.
value
=
true
;
watchEffect
(()
=>
{
tableProps
&&
instance
.
setProps
(
getDynamicProps
(
tableProps
));
});
watch
(
()
=>
tableProps
,
()
=>
{
tableProps
&&
instance
.
setProps
(
getDynamicProps
(
tableProps
));
},
{
immediate
:
true
,
}
);
}
function
getTableInstance
():
TableActionType
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录