From 751f1b62bf92eedfbfa5fa4e329031833b220888 Mon Sep 17 00:00:00 2001 From: colton <1679963578@qq.com> Date: Wed, 26 Jun 2024 10:36:52 +0800 Subject: [PATCH] feat: default use zh-CN(temporarily) --- src/components/common/DivText.tsx | 6 +++--- src/components/common/header.tsx | 2 +- src/components/routes/home.tsx | 10 +++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/common/DivText.tsx b/src/components/common/DivText.tsx index fbe2336..23171ad 100644 --- a/src/components/common/DivText.tsx +++ b/src/components/common/DivText.tsx @@ -10,9 +10,9 @@ const DivText: FC = ({ textArray = [] }) => { {textArray.length && textArray.map((item, key) => { return ( -
- {item.text}: - {item.value} +
+ {item.text}: + {item.value}
); })} diff --git a/src/components/common/header.tsx b/src/components/common/header.tsx index 4290e2e..2a590b7 100644 --- a/src/components/common/header.tsx +++ b/src/components/common/header.tsx @@ -43,7 +43,7 @@ export function Header(p: HTMLAttributes) {
- LngList} reload={false} /> + {/* LngList} reload={false} /> */} {!isMobile && }
diff --git a/src/components/routes/home.tsx b/src/components/routes/home.tsx index 2d2e647..cc9005e 100644 --- a/src/components/routes/home.tsx +++ b/src/components/routes/home.tsx @@ -11,10 +11,10 @@ import { import { useT } from '@/lib/hooks/useT'; import { scrollToAnchor } from '@/lib/utils'; import classNames from 'classnames'; -import { Fragment, useState } from 'react'; +import { Fragment, useEffect, useState } from 'react'; import { WrapLink } from '../ant/Link'; import { Btn } from '../common/button'; -import { useNavigate } from '@umijs/max'; +import { setLocale, useNavigate } from '@umijs/max'; function Card() { const { user } = useUser(); @@ -276,7 +276,7 @@ function CardTabs() {
-
    +
      {tabsList.map((v, i) => { return (
    • @@ -331,6 +331,10 @@ function CardTabs() { export function Home() { const { user } = useUser(); + + useEffect(() => { + setLocale('zh-CN'); + }, []); return (