import { useCtx } from "@/comm/ctx"; import { css } from "@linaria/core"; import { Button, Form, Input, Select } from "ant-design-vue"; import { useModal } from "queenjs"; import { defineComponent, reactive } from "vue"; import { string } from "vue-types"; const layout = { wrapperCol: { span: 24 }, }; export default defineComponent({ props: { thumbnail: string(), name: string(), }, setup(props) { const modal = useModal(); const { storeCtrl } = useCtx(); const formState = reactive({ thumbnail: props.thumbnail, name: props.name, category: "default", }); const rules = reactive({ name: [ { required: true, message: "名称不能为空", trigger: "change" }, { min: 2, max: 20, message: "长度为2~20位字符", trigger: "change", }, ], }); const { validate, validateInfos } = Form.useForm(formState, rules); const changeCategory = (v: any) => { formState.category = v; }; const saveSubmit = async () => { await validate(); modal.submit(formState); }; return () => { return (