Cookbook: a CRUD page
Everything from the other pages in the shape real screens have: a searchable paginated table, one form for create and edit in a slideover, delete with confirmation, server validation errors under the inputs, toasts for the outcome.
How the pieces fit
loaders/users.tsdeclares the resource once; the page only calls it.- The table renders
users.fetch; its events callfetchPageChangeandfetchSearch. - The form does not know about the API: submit calls
addRunorupdateRun. useWatchTrueon each status closes the form, shows a toast and refreshes the list.- Try an email that exists (
[email protected]) to see a server error land on the field.
Users
examples/cookbook/Crud.vue0 จากทั้งหมด 0
| Name | Role | Salary | Status | ||
|---|---|---|---|---|---|
ไม่พบข้อมูล! | |||||
0 จากทั้งหมด 0
