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
This commit is contained in:
parent
0cfaa40bd0
commit
f62043b1fc
|
|
@ -294,7 +294,7 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
setProps,
|
...formActionType,
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,10 @@ export function useFormEvents({
|
||||||
const { componentProps } = schema || {};
|
const { componentProps } = schema || {};
|
||||||
let _props = componentProps as any;
|
let _props = componentProps as any;
|
||||||
if (typeof componentProps === 'function') {
|
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);
|
const constructValue = tryConstructArray(key, values) || tryConstructObject(key, values);
|
||||||
|
|
@ -338,6 +341,10 @@ export function useFormEvents({
|
||||||
return handleFormValues(values);
|
return handleFormValues(values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function setProps(formProps: Partial<FormProps>): Promise<void> {
|
||||||
|
await unref(formElRef)?.setProps(formProps);
|
||||||
|
}
|
||||||
|
|
||||||
async function validate(nameList?: NamePath[] | false | undefined) {
|
async function validate(nameList?: NamePath[] | false | undefined) {
|
||||||
let _nameList: any;
|
let _nameList: any;
|
||||||
if (nameList === undefined) {
|
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 {
|
return {
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
clearValidate,
|
clearValidate,
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,10 @@
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
wrap,
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.native) return;
|
if (props.native) return;
|
||||||
nextTick(update);
|
nextTick(update);
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,7 @@
|
||||||
|
|
||||||
emit('register', tableAction, formActions);
|
emit('register', tableAction, formActions);
|
||||||
|
|
||||||
defineExpose({ tableAction });
|
defineExpose({ ...tableAction });
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@border-color: #cecece4d;
|
@border-color: #cecece4d;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"lang": {
|
"lang": {
|
||||||
"shortWeekDays": ["一", "二", "三", "四", "五", "六", "日"],
|
"shortWeekDays": ["日","一", "二", "三", "四", "五", "六"],
|
||||||
"shortMonths": [
|
"shortMonths": [
|
||||||
"1月",
|
"1月",
|
||||||
"2月",
|
"2月",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue