visuddhinanda 3 лет назад
Родитель
Сommit
c5d6f232f9
1 измененных файлов с 36 добавлено и 32 удалено
  1. 36 32
      dashboard/src/pages/library/dict/show.tsx

+ 36 - 32
dashboard/src/pages/library/dict/show.tsx

@@ -9,39 +9,43 @@ const { Content, Header } = Layout;
 const { Search } = Input;
 
 const Widget = () => {
-	const navigate = useNavigate();
-	const { word } = useParams(); //url 参数
-	const [wordSearch, setWordSearch] = useState(word);
+  const navigate = useNavigate();
+  const { word } = useParams(); //url 参数
+  const [wordSearch, setWordSearch] = useState(word);
 
-	const onSearch = (value: string) => {
-		console.log("onSearch", value);
-		setWordSearch(value);
-		navigate("/dict/" + value);
-	};
-	return (
-		<>
-			<Layout>
-				<Affix offsetTop={0}>
-					<Header style={{ backgroundColor: "gray", height: "3.5em" }}>
-						<Row style={{ paddingTop: "0.5em" }}>
-							<Col span="8" offset={8}>
-								<Search placeholder="input search text" onSearch={onSearch} style={{ width: "100%" }} />
-							</Col>
-						</Row>
-					</Header>
-				</Affix>
-				<Content>
-					<Row>
-						<Col flex="auto"></Col>
-						<Col flex="1260px">
-							<DictSearch word={wordSearch} />
-						</Col>
-						<Col flex="auto"></Col>
-					</Row>
-				</Content>
-			</Layout>
-		</>
-	);
+  const onSearch = (value: string) => {
+    console.log("onSearch", value);
+    setWordSearch(value);
+    navigate("/dict/" + value);
+  };
+  return (
+    <>
+      <Layout>
+        <Affix offsetTop={0}>
+          <div style={{ backgroundColor: "gray", height: "3.5em" }}>
+            <Row style={{ paddingTop: "0.5em" }}>
+              <Col span="8" offset={8}>
+                <Search
+                  placeholder="input search text"
+                  onSearch={onSearch}
+                  style={{ width: "100%" }}
+                />
+              </Col>
+            </Row>
+          </div>
+        </Affix>
+        <Content>
+          <Row>
+            <Col flex="auto"></Col>
+            <Col flex="1260px">
+              <DictSearch word={wordSearch} />
+            </Col>
+            <Col flex="auto"></Col>
+          </Row>
+        </Content>
+      </Layout>
+    </>
+  );
 };
 
 export default Widget;