Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
d81481c5
提交
d81481c5
authored
6月 06, 2021
作者:
Vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(table): try to get close to the form stuck
上级
19d8e01e
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
20 行增加
和
14 行删除
+20
-14
useTable.ts
src/components/Table/src/hooks/useTable.ts
+20
-14
没有找到文件。
src/components/Table/src/hooks/useTable.ts
浏览文件 @
d81481c5
...
@@ -2,10 +2,16 @@ import type { BasicTableProps, TableActionType, FetchParams, BasicColumn } from
...
@@ -2,10 +2,16 @@ import type { BasicTableProps, TableActionType, FetchParams, BasicColumn } from
import
type
{
PaginationProps
}
from
'../types/pagination'
;
import
type
{
PaginationProps
}
from
'../types/pagination'
;
import
type
{
DynamicProps
}
from
'/#/utils'
;
import
type
{
DynamicProps
}
from
'/#/utils'
;
import
type
{
FormActionType
}
from
'/@/components/Form'
;
import
type
{
FormActionType
}
from
'/@/components/Form'
;
import
type
{
WatchStopHandle
}
from
'vue'
;
//
import type { WatchStopHandle } from 'vue';
import
{
getDynamicProps
}
from
'/@/utils'
;
import
{
getDynamicProps
}
from
'/@/utils'
;
import
{
ref
,
onUnmounted
,
unref
,
watch
,
toRaw
}
from
'vue'
;
import
{
ref
,
onUnmounted
,
unref
,
// watch,
toRaw
,
}
from
'vue'
;
import
{
isProdMode
}
from
'/@/utils/env'
;
import
{
isProdMode
}
from
'/@/utils/env'
;
import
{
error
}
from
'/@/utils/log'
;
import
{
error
}
from
'/@/utils/log'
;
...
@@ -25,7 +31,7 @@ export function useTable(tableProps?: Props): [
...
@@ -25,7 +31,7 @@ export function useTable(tableProps?: Props): [
const
loadedRef
=
ref
<
Nullable
<
boolean
>>
(
false
);
const
loadedRef
=
ref
<
Nullable
<
boolean
>>
(
false
);
const
formRef
=
ref
<
Nullable
<
UseTableMethod
>>
(
null
);
const
formRef
=
ref
<
Nullable
<
UseTableMethod
>>
(
null
);
let
stopWatch
:
WatchStopHandle
;
//
let stopWatch: WatchStopHandle;
function
register
(
instance
:
TableActionType
,
formInstance
:
UseTableMethod
)
{
function
register
(
instance
:
TableActionType
,
formInstance
:
UseTableMethod
)
{
isProdMode
()
&&
isProdMode
()
&&
...
@@ -41,18 +47,18 @@ export function useTable(tableProps?: Props): [
...
@@ -41,18 +47,18 @@ export function useTable(tableProps?: Props): [
tableProps
&&
instance
.
setProps
(
getDynamicProps
(
tableProps
));
tableProps
&&
instance
.
setProps
(
getDynamicProps
(
tableProps
));
loadedRef
.
value
=
true
;
loadedRef
.
value
=
true
;
stopWatch
?.();
//
stopWatch?.();
stopWatch
=
watch
(
//
stopWatch = watch(
()
=>
tableProps
,
//
() => tableProps,
()
=>
{
//
() => {
tableProps
&&
instance
.
setProps
(
getDynamicProps
(
tableProps
));
//
tableProps && instance.setProps(getDynamicProps(tableProps));
},
//
},
{
//
{
immediate
:
true
,
//
immediate: true,
deep
:
true
,
//
deep: true,
}
//
}
);
//
);
}
}
function
getTableInstance
():
TableActionType
{
function
getTableInstance
():
TableActionType
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论