mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-02-03 02:54:40 +08:00
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({
|
||||
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月",
|
||||
|
Loading…
Reference in New Issue
Block a user