Browse Source
fix(DatePicker): date show is wrong and setup script defineExpose (#3324 )
* fix(useFormEvents): some function is lost in componentsProps
* fix(useFormEvents): some function is lost in componentsProps
* fix(useFormEvents): some function is lost in componentsProps
* fix(DatePicker): date show is wrong
* fix(useFormEvents): some function is lost in componentsProps
* fix(useFormEvents): some function is lost in componentsProps
* fix(useFormEvents): some function is lost in componentsProps
* fix(DatePicker): date show is wrong
* fix(DatePicker): date show is wrong
pull/3327/head
zhang
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
31 additions and
4 deletions
src/components/Form/src/BasicForm.vue
src/components/Form/src/hooks/useFormEvents.ts
src/components/Scrollbar/src/Scrollbar.vue
src/components/Table/src/BasicTable.vue
src/locales/lang/zh-CN/antdLocale/DatePicker.json
@ -294,7 +294,7 @@
) ;
defineExpose ( {
setProps ,
... formActionType ,
} ) ;
onMounted ( ( ) => {
@ -123,7 +123,10 @@ export function useFormEvents({
const { componentProps } = schema || { } ;
let _props = componentProps as any ;
if ( typeof componentProps === 'function' ) {
_props = _props ( { formModel : unref ( formModel ) , formActionType : unref ( formElRef ) } ) ;
_props = _props ( {
formModel : unref ( formModel ) ,
formActionType ,
} ) ;
}
const constructValue = tryConstructArray ( key , values ) || tryConstructObject ( key , values ) ;
@ -338,6 +341,10 @@ export function useFormEvents({
return handleFormValues ( values ) ;
}
async function setProps ( formProps : Partial < FormProps > ) : Promise < void > {
await unref ( formElRef ) ? . setProps ( formProps ) ;
}
async function validate ( nameList? : NamePath [ ] | false | undefined ) {
let _nameList : any ;
if ( nameList === undefined ) {
@ -380,6 +387,22 @@ export function useFormEvents({
}
}
const formActionType : Partial < FormActionType > = {
getFieldsValue ,
setFieldsValue ,
resetFields ,
updateSchema ,
resetSchema ,
setProps ,
removeSchemaByField ,
appendSchemaByField ,
clearValidate ,
validateFields ,
validate ,
submit : handleSubmit ,
scrollToField : scrollToField ,
} ;
return {
handleSubmit ,
clearValidate ,
@ -101,6 +101,10 @@
} ,
) ;
defineExpose ( {
wrap ,
} ) ;
onMounted ( ( ) => {
if ( props . native ) return ;
nextTick ( update ) ;
@ -320,7 +320,7 @@
emit ( 'register' , tableAction , formActions ) ;
defineExpose ( { tableAction } ) ;
defineExpose ( { ... tableAction } ) ;
< / script >
< style lang = "less" >
@ border - color : # cecece4d ;
@ -1,6 +1,6 @@
{
"lang" : {
"shortWeekDays" : [ "一" , "二" , "三" , "四" , "五" , "六" , "日 " ] ,
"shortWeekDays" : [ "日" , " 一" , "二" , "三" , "四" , "五" , "六" ] ,
"shortMonths" : [
"1月" ,
"2月" ,