|
@@ -18,7 +18,7 @@ import "dayjs/locale/zh-cn";
|
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
|
dayjs.locale("zh-cn");
|
|
dayjs.locale("zh-cn");
|
|
|
|
|
|
|
|
-export const EasyConfig = forwardRef((props, ref) => {
|
|
|
|
|
|
|
+const EasyConfig = forwardRef((props, ref) => {
|
|
|
const { editId = -1, onConfirm } = props;
|
|
const { editId = -1, onConfirm } = props;
|
|
|
const compRef = useRef(null);
|
|
const compRef = useRef(null);
|
|
|
|
|
|
|
@@ -30,15 +30,11 @@ export const EasyConfig = forwardRef((props, ref) => {
|
|
|
}
|
|
}
|
|
|
}, [themeName]);
|
|
}, [themeName]);
|
|
|
|
|
|
|
|
- useImperativeHandle(
|
|
|
|
|
- ref,
|
|
|
|
|
- () => {
|
|
|
|
|
- return {
|
|
|
|
|
- fetchData: compRef.ok(),
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- []
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ useImperativeHandle(ref, () => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ok: compRef?.current?.ok,
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<ThemeWrapper setThemeName={setThemeName}>
|
|
<ThemeWrapper setThemeName={setThemeName}>
|
|
@@ -57,7 +53,7 @@ export const EasyConfig = forwardRef((props, ref) => {
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-export const ComplexConfig = forwardRef((props, ref) => {
|
|
|
|
|
|
|
+const ComplexConfig = forwardRef((props, ref) => {
|
|
|
const { editId = -1, onConfirm } = props;
|
|
const { editId = -1, onConfirm } = props;
|
|
|
const compRef = useRef(null);
|
|
const compRef = useRef(null);
|
|
|
|
|
|
|
@@ -69,15 +65,13 @@ export const ComplexConfig = forwardRef((props, ref) => {
|
|
|
}
|
|
}
|
|
|
}, [themeName]);
|
|
}, [themeName]);
|
|
|
|
|
|
|
|
- useImperativeHandle(
|
|
|
|
|
- ref,
|
|
|
|
|
- () => {
|
|
|
|
|
- return {
|
|
|
|
|
- fetchData: compRef.ok(),
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- []
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ useImperativeHandle(ref, () => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ok: compRef?.current?.ok,
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ console.log(compRef);
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<ThemeWrapper setThemeName={setThemeName}>
|
|
<ThemeWrapper setThemeName={setThemeName}>
|
|
@@ -95,3 +89,8 @@ export const ComplexConfig = forwardRef((props, ref) => {
|
|
|
</ThemeWrapper>
|
|
</ThemeWrapper>
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ EasyConfig,
|
|
|
|
|
+ ComplexConfig,
|
|
|
|
|
+};
|