Przeglądaj źródła

添加宽度属性

visuddhinanda 3 lat temu
rodzic
commit
17172627c2

+ 5 - 2
dashboard/src/components/general/LangSelect.tsx

@@ -1,7 +1,10 @@
 import { useIntl } from "react-intl";
 import { ProFormSelect } from "@ant-design/pro-components";
 
-const Widget = () => {
+interface IWidget {
+  width?: number | "md" | "sm" | "xl" | "xs" | "lg";
+}
+const Widget = ({ width }: IWidget) => {
   const intl = useIntl();
 
   const langOptions = [
@@ -21,7 +24,7 @@ const Widget = () => {
   return (
     <ProFormSelect
       options={langOptions}
-      width="sm"
+      width={width}
       name="lang"
       showSearch
       debounceTime={300}

+ 35 - 33
dashboard/src/components/studio/PublicitySelect.tsx

@@ -1,39 +1,41 @@
 import { ProFormSelect } from "@ant-design/pro-components";
 import { useIntl } from "react-intl";
+interface IWidget {
+  width?: number | "md" | "sm" | "xl" | "xs" | "lg";
+}
+const Widget = ({ width }: IWidget) => {
+  const intl = useIntl();
 
-const Widget = () => {
-	const intl = useIntl();
-
-	const options = [
-		{
-			value: 0,
-			label: intl.formatMessage({
-				id: "forms.fields.publicity.disable.label",
-			}),
-		},
-		{
-			value: 10,
-			label: intl.formatMessage({
-				id: "forms.fields.publicity.private.label",
-			}),
-		},
-		{
-			value: 30,
-			label: intl.formatMessage({
-				id: "forms.fields.publicity.public.label",
-			}),
-		},
-	];
-	return (
-		<ProFormSelect
-			options={options}
-			initialValue={10}
-			width="sm"
-			name="status"
-			allowClear={false}
-			label={intl.formatMessage({ id: "forms.fields.publicity.label" })}
-		/>
-	);
+  const options = [
+    {
+      value: 0,
+      label: intl.formatMessage({
+        id: "forms.fields.publicity.disable.label",
+      }),
+    },
+    {
+      value: 10,
+      label: intl.formatMessage({
+        id: "forms.fields.publicity.private.label",
+      }),
+    },
+    {
+      value: 30,
+      label: intl.formatMessage({
+        id: "forms.fields.publicity.public.label",
+      }),
+    },
+  ];
+  return (
+    <ProFormSelect
+      options={options}
+      initialValue={10}
+      width={width}
+      name="status"
+      allowClear={false}
+      label={intl.formatMessage({ id: "forms.fields.publicity.label" })}
+    />
+  );
 };
 
 export default Widget;