芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/reginaeigbe.com/folder/admin/tmp/resources/js/Admin/Pages/Posts/Create.jsx
import AdminLayouts from "@/Admin/Layouts/AdminLayouts"; import TextInput from "@/Admin/Components/Inputs/TextInput.jsx"; import CustomSelect from "@/Admin/Components/Inputs/CustomSelect.jsx"; import TagInput from "@/Admin/Components/Inputs/TagInput"; import FileUpload from "@/Admin/Components/Inputs/FileUpload.jsx"; import { useForm, Head } from "@inertiajs/react"; import Editor from "@/Admin/Components/Inputs/Editor"; import SuccessButton from "@/Admin/Components/Button/SuccessButton"; import DangerButton from "@/Admin/Components/Button/DangerButton.jsx"; import FromValidationError from "@/Admin/Components/Validation/FromValidationError.jsx"; export default function Create({ categories }) { const { data, setData, errors, post, processing } = useForm({ category: "", category_name: "", tags: [], thumbnail_image: null, add_new_category: false, title: "", content: "", status: "", meta_title: "", meta_description: "", }); // handle publish const handlePublish = (e) => { e.preventDefault(); post(route("admin.posts.store")); }; return (
Create Posts
Post Details
setData("title", e.target.value) } />
Content *
setData("content", data) } />
SEO Details
setData( "meta_title", e.target.value ) } />
setData( "meta_description", e.target.value ) } />
Category
{data.add_new_category ? (
setData( "category_name", e.target.value ) } /> ) : (
setData("category", e) } /> )}
{data.add_new_category ? (
setData( "add_new_category", false ) } > + Select existing category
) : (
setData( "add_new_category", true ) } > + Add new category
)}
Tags
setData("tags", tags) } id="tags" />
Featured image
setData("thumbnail_image", file) } />
setData("status", "0")} > UnPublish
setData("status", "1")} > Publish
); }