浏览代码

resId可以不提供

visuddhinanda 3 年之前
父节点
当前提交
b112442dbd
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      dashboard/src/components/comment/CommentCreate.tsx

+ 3 - 3
dashboard/src/components/comment/CommentCreate.tsx

@@ -16,12 +16,12 @@ import { currentUser as _currentUser } from "../../reducers/current-user";
 import { useRef } from "react";
 import { useRef } from "react";
 
 
 interface IWidget {
 interface IWidget {
-  resId: string;
-  resType: string;
+  resId?: string;
+  resType?: string;
   parent?: string;
   parent?: string;
   onCreated?: Function;
   onCreated?: Function;
 }
 }
-const Widget = ({ resId, resType, parent, onCreated }: IWidget) => {
+const Widget = ({ resId = "", resType = "", parent, onCreated }: IWidget) => {
   const intl = useIntl();
   const intl = useIntl();
   const formRef = useRef<ProFormInstance>();
   const formRef = useRef<ProFormInstance>();
   const _currUser = useAppSelector(_currentUser);
   const _currUser = useAppSelector(_currentUser);