diff --git a/comps/form/field/FieldInput.tsx b/comps/form/field/FieldInput.tsx
index 8c5bafe..481bdec 100755
--- a/comps/form/field/FieldInput.tsx
+++ b/comps/form/field/FieldInput.tsx
@@ -135,7 +135,7 @@ export const FieldInput: FC<{
{prefix && prefix !== "" ? (
& {
- params?: {
- name?: string;
- where?: any;
- create?: any;
- update?: any;
- breads?: { label: string; url?: string }[];
- };
- }
-> = (props) => {
+export const NavLink: FC<{
+ className?: string;
+ href?: string;
+ children?: any;
+ back_title?: string;
+ params?: {
+ name?: string;
+ where?: any;
+ create?: any;
+ update?: any;
+ breads?: { label: string; url?: string }[];
+ };
+}> = (props) => {
const local = useLocal({ loading: false });
let href = props.href || "";
@@ -42,13 +44,26 @@ export const NavLink: FC<
setTimeout(() => {
local.loading = false;
}, 3000);
+ } else if (props.back_title) {
+ local.loading = true;
+ local.render();
+ navigate(props.href, { breads: [{ label: props.back_title }] });
+ setTimeout(() => {
+ local.loading = false;
+ }, 3000);
} else {
navigate(props.href);
}
}
}}
>
- {local.loading ?
: props.children}
+ {local.loading ? (
+
+
+
+ ) : (
+ props.children
+ )}
);
};