Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
f9645337
Unverified
提交
f9645337
authored
12月 28, 2021
作者:
1sm
提交者:
GitHub
12月 28, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(BasicForm): add `submitOnChange` option (#1521)
上级
dd158a17
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
15 行增加
和
3 行删除
+15
-3
BasicForm.vue
src/components/Form/src/BasicForm.vue
+9
-0
props.ts
src/components/Form/src/props.ts
+1
-0
form.ts
src/components/Form/src/types/form.ts
+2
-0
index.vue
src/layouts/default/feature/index.vue
+2
-2
projectSetting.ts
src/settings/projectSetting.ts
+1
-1
没有找到文件。
src/components/Form/src/BasicForm.vue
浏览文件 @
f9645337
...
...
@@ -58,6 +58,7 @@
import
{
createFormContext
}
from
'./hooks/useFormContext'
;
import
{
useAutoFocus
}
from
'./hooks/useAutoFocus'
;
import
{
useModalContext
}
from
'/@/components/Modal'
;
import
{
useDebounceFn
}
from
'@vueuse/core'
;
import
{
basicProps
}
from
'./props'
;
import
{
useDesign
}
from
'/@/hooks/web/useDesign'
;
...
...
@@ -225,6 +226,14 @@
},
);
watch
(
()
=>
formModel
,
useDebounceFn
(()
=>
{
unref
(
getProps
).
submitOnChange
&&
handleSubmit
();
},
300
),
{
deep
:
true
},
);
async
function
setProps
(
formProps
:
Partial
<
FormProps
>
):
Promise
<
void
>
{
propsRef
.
value
=
deepMerge
(
unref
(
propsRef
)
||
{},
formProps
);
}
...
...
src/components/Form/src/props.ts
浏览文件 @
f9645337
...
...
@@ -40,6 +40,7 @@ export const basicProps = {
// 在INPUT组件上单击回车时,是否自动提交
autoSubmitOnEnter
:
propTypes
.
bool
.
def
(
false
),
submitOnReset
:
propTypes
.
bool
,
submitOnChange
:
propTypes
.
bool
,
size
:
propTypes
.
oneOf
([
'default'
,
'small'
,
'large'
]).
def
(
'default'
),
// 禁用表单
disabled
:
propTypes
.
bool
,
...
...
src/components/Form/src/types/form.ts
浏览文件 @
f9645337
...
...
@@ -60,6 +60,8 @@ export interface FormProps {
rowProps
?:
RowProps
;
// Submit form on reset
submitOnReset
?:
boolean
;
// Submit form on form changing
submitOnChange
?:
boolean
;
// Col configuration for the entire form
labelCol
?:
Partial
<
ColEx
>
;
// Col configuration for the entire form
...
...
src/layouts/default/feature/index.vue
浏览文件 @
f9645337
...
...
@@ -23,7 +23,7 @@
const
{
getUseOpenBackTop
,
getShowSettingButton
,
getSettingButtonPosition
,
getFullContent
}
=
useRootSetting
();
const
userStore
=
useUserStoreWithOut
();
const
{
prefixCls
}
=
useDesign
(
'setting-drawer-fea
r
ure'
);
const
{
prefixCls
}
=
useDesign
(
'setting-drawer-fea
t
ure'
);
const
{
getShowHeader
}
=
useHeaderSetting
();
const
getIsSessionTimeout
=
computed
(()
=>
userStore
.
getSessionTimeout
);
...
...
@@ -59,7 +59,7 @@
</
template
>
<
style
lang=
"less"
>
@prefix-cls
:
~
'@{namespace}-setting-drawer-fea
r
ure'
;
@prefix-cls
:
~
'@{namespace}-setting-drawer-fea
t
ure'
;
.@
{
prefix-cls
}
{
position
:
absolute
;
...
...
src/settings/projectSetting.ts
浏览文件 @
f9645337
...
...
@@ -134,7 +134,7 @@ const setting: ProjectConfig = {
// Transition Setting
transitionSetting
:
{
// Whether to open the page switching animation
// The disabled state will also disable pageLoadin
n
g
// The disabled state will also disable pageLoading
enable
:
true
,
// Route basic switching animation
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论