feat: support f-partial on buttons (#1867)

This commit is contained in:
Marvin Hagemeister
2023-10-05 13:53:51 +02:00
committed by GitHub
parent 776a721332
commit 6598eb39a0
5 changed files with 239 additions and 154 deletions
@@ -0,0 +1,19 @@
import { Partial } from "$fresh/runtime.ts";
import { Fader } from "../../islands/Fader.tsx";
export default function ModeDemo() {
return (
<div f-client-nav>
<Partial name="body">
<Fader>
<p class="status-initial">Initial content</p>
</Fader>
</Partial>
<p>
<button f-partial="/button/update">
update
</button>
</p>
</div>
);
}
@@ -0,0 +1,19 @@
import { defineRoute } from "$fresh/src/server/defines.ts";
import { RouteConfig } from "$fresh/server.ts";
import { Partial } from "$fresh/runtime.ts";
import { Fader } from "../../islands/Fader.tsx";
export const config: RouteConfig = {
skipAppWrapper: true,
skipInheritedLayouts: true,
};
export default defineRoute((req, ctx) => {
return (
<Partial name="body">
<Fader>
<p class="status-updated">update</p>
</Fader>
</Partial>
);
});