From 9d0894742d25b00c5f13bc459c739bdb815ba021 Mon Sep 17 00:00:00 2001 From: Yunfei He Date: Thu, 26 Nov 2026 20:25:52 +0800 Subject: [PATCH] docs: fix setup errors and gaps in the guides --- docs/guide/jobs.md | 2 +- docs/guide/pages-routing/actions-and-forms.md | 51 +++++++++++++------ docs/guide/pages-routing/errors.md | 4 +- docs/guide/queues.md | 2 +- docs/integrations/frameworks/sveltekit.md | 2 +- docs/reference/cli/database.md | 2 +- docs/reference/cli/setup.md | 2 + 7 files changed, 45 insertions(+), 20 deletions(-) diff --git a/docs/guide/jobs.md b/docs/guide/jobs.md index f0c613774..d484dcd7c 100644 --- a/docs/guide/jobs.md +++ b/docs/guide/jobs.md @@ -62,7 +62,7 @@ Content-Type: application/json Set `cron` to an expression exported by your job. A successful call returns `{ "ok": true }`. -The endpoint requires a local dev trigger token. Void prints a paste-ready curl command with the current token when the dev server starts. +The endpoint requires a local dev trigger token. Void prints a paste-ready curl command with the current token when the dev server starts. The development trigger is unavailable in `vp preview` and `vite preview`. ```bash curl -X POST http://localhost:5173/__void/scheduled \ diff --git a/docs/guide/pages-routing/actions-and-forms.md b/docs/guide/pages-routing/actions-and-forms.md index dfcf47a46..a72f6718b 100644 --- a/docs/guide/pages-routing/actions-and-forms.md +++ b/docs/guide/pages-routing/actions-and-forms.md @@ -34,9 +34,9 @@ Middleware does not run again after the action. To change [shared data](./layout ## Form -Pair `Form` with `useForm` to submit values and display validation and action errors. Inputs stay editable when a submission fails. +Pair `Form` with `useForm` to submit values. Inputs stay editable when a submission fails. `Form` shows an alert above the fields when there is an error. The alert shows the action error from `form.error` when present and joins the messages from `form.errors` otherwise. -Import `Form` from your adapter. Pass `form` and, optionally, `method="put"`, `"patch"`, or `"delete"`; the default is `"post"`. Use `renderError` for a custom action-error renderer (a snippet in Svelte). +Import `Form` from your adapter. Pass `form` and optionally set `method` to `"put"`, `"patch"`, or `"delete"`. The default is `"post"`. Use `renderError` for custom action-error text (a snippet in Svelte). Field messages use the alert with or without `renderError`. ## `useForm` @@ -66,14 +66,12 @@ export default function CreateUser() { value={form.data.name} onChange={(e) => form.setData('name', e.target.value)} /> - {form.errors.name && {form.errors.name}} form.setData('email', e.target.value)} /> - {form.errors.email && {form.errors.email}} @@ -92,10 +90,7 @@ const form = useForm('/users', { name: '', email: '' });