芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/reginaeigbe.com/folder/admin/tmp/resources/js/Admin/Pages/Users/Create.jsx
import AdminLayouts from "@/Admin/Layouts/AdminLayouts"; import TextInput from "@/Admin/Components/Inputs/TextInput.jsx"; import { useForm, Head } from "@inertiajs/react"; export default function Create({ roles }) { const { data, setData, errors, post, processing } = useForm({ name: "", email: "", about: "", role: "", password: "", }); // handle publish const handlePublish = (e) => { e.preventDefault(); post(route("admin.users.store")); }; return (
Create user
User Details
setData("name", e.target.value) } />
setData("email", e.target.value) } />
setData("password", e.target.value) } />
setData("about", e.target.value) } />
setData( "role", e.target.value ) } value={data.role} >
Select Role
{roles.map((role, index) => (
{role.title}
))}
{errors.role && (
{errors.role}
)}
Submit
); }