File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -629,6 +629,7 @@ export default {
629629formFooter = {
630630 show: true , // 是否显示默认底部
631631 okBtn: ' 保存' , // 确认按钮文字
632+ okBtnProps: { type: ' primary' }, // 传递确认按钮的 props,例如配置按钮 loading 状态 okBtnProps: { loading: true }
632633 cancelBtn: ' 取消' , // 取消按钮文字
633634
634635 // 透传给formFooter 中的formItem组件的参数
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ export default {
1313 type : String ,
1414 default : '保存'
1515 } ,
16+ okBtnProps : {
17+ type : Object ,
18+ default : ( ) => ( { } )
19+ } ,
1620 cancelBtn : {
1721 type : String ,
1822 default : '取消'
@@ -49,7 +53,7 @@ export default {
4953 style : {
5054 marginLeft : '10px'
5155 } ,
52- type : 'primary' ,
56+ ... Object . assign ( { type : 'primary' } , props . okBtnProps ) ,
5357 onClick ( ) {
5458 emit ( 'submit' ) ;
5559 }
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export default function createForm(globalOptions = {}) {
5555 const footerParams = computed ( ( ) => ( {
5656 show : true ,
5757 okBtn : '保存' ,
58+ okBtnProps : { type : 'primary' } ,
5859 cancelBtn : '取消' ,
5960 ...props . formFooter
6061 } ) ) ;
@@ -116,6 +117,7 @@ export default function createForm(globalOptions = {}) {
116117 return h ( FormFooter , {
117118 globalOptions,
118119 okBtn : footerParams . value . okBtn ,
120+ okBtnProps : footerParams . value . okBtnProps ,
119121 cancelBtn : footerParams . value . cancelBtn ,
120122 formItemAttrs : footerParams . value . formItemAttrs ,
121123 onCancel ( ) {
You can’t perform that action at this time.
0 commit comments