From 0afe8e6624cf74cbed32ef9c1b10b34806910e1f Mon Sep 17 00:00:00 2001 From: abearxiong Date: Thu, 12 Mar 2026 14:52:35 +0800 Subject: [PATCH] chore: update README and clean up code structure --- kevisual.json | 24 ++++++++++++++++++++++++ readme.md | 7 +++++++ src/app.ts | 8 ++++---- src/pages/index/index.tsx | 32 +++++--------------------------- 4 files changed, 40 insertions(+), 31 deletions(-) create mode 100644 kevisual.json diff --git a/kevisual.json b/kevisual.json new file mode 100644 index 0000000..92a5a64 --- /dev/null +++ b/kevisual.json @@ -0,0 +1,24 @@ +{ + "metadata": { + "name": "kevisual", + "share": "public" + }, + "ignore": [ + ".swc" + ], + "registry": "https://kevisual.cn/root/ai/kevisual/mini/taro-template", + "clone": { + ".": { + "enabled": true + } + }, + "syncd": [ + { + "files": [ + "**/*" + ], + "registry": "" + } + ], + "sync": {} +} \ No newline at end of file diff --git a/readme.md b/readme.md index e69de29..65b6e76 100644 --- a/readme.md +++ b/readme.md @@ -0,0 +1,7 @@ +# + +## clone + +```bash +ev sync clone -i https://kevisual.cn/root/ai/kevisual/mini/taro-template/kevisual.json +``` \ No newline at end of file diff --git a/src/app.ts b/src/app.ts index b6cf4d2..5743225 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,17 +1,17 @@ -import React, { useEffect } from 'react' +import { useEffect } from 'react' import { useDidShow, useDidHide } from '@tarojs/taro' // 全局样式 import './app.scss' function App(props) { // 可以使用所有的 React Hooks - useEffect(() => {}) + useEffect(() => { }) // 对应 onShow - useDidShow(() => {}) + useDidShow(() => { }) // 对应 onHide - useDidHide(() => {}) + useDidHide(() => { }) return props.children } diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 8530e6c..66348ac 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -1,13 +1,8 @@ -import React, { useState } from 'react' +import { useState } from 'react' import { View } from '@tarojs/components' -import { Button, ConfigProvider, TextArea, Dialog } from '@nutui/nutui-react-taro' -import enUS from '@nutui/nutui-react-taro/dist/locales/en-US' -import zhCN from '@nutui/nutui-react-taro/dist/locales/zh-CN' +import { ConfigProvider } from '@nutui/nutui-react-taro' import './index.scss' function Index() { - const [locale, setLocale] = useState(zhCN) - const localeKey = locale === zhCN ? 'zhCN' : 'enUS' - const [visible, setVisible] = useState(false) const [translated] = useState({ zhCN: { welcome: '欢迎使用 NutUI React 开发 Taro 多端项目。', @@ -20,28 +15,11 @@ function Index() { open: 'Click Me', }, }) - const handleSwitchLocale = () => { - setLocale(locale === zhCN ? enUS : zhCN) - } + return ( - + - {translated[localeKey].welcome} - - - - setVisible(false)} - onCancel={() => setVisible(false)}> - {translated[localeKey].welcome} - -