Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: configprovider docs #3031

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions src/packages/configprovider/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,30 @@ import Demo3 from './demos/taro/demo3'
import Demo4 from './demos/taro/demo4'
import Demo5 from './demos/taro/demo5'
import { useTranslate } from '@/sites/assets/locale/taro'
import { harmony } from '@/utils/platform-taro'

const ConfigProviderDemo = () => {
const [translated] = useTranslate({
'zh-CN': {
title1: 'Textarea 默认',
title2: 'Textarea 英文',
title1: 'Textarea 默认-禁用',
title2: 'Textarea 英文-禁用',
defaultTheme: '默认主题',
customTheme: '定制主题',
customTheme: `定制主题${harmony() ? '【暂不支持】' : ''}`,
RTL: harmony() ? 'RTL【暂不支持】' : 'RTL',
},
'zh-TW': {
title1: '默認用法',
title2: 'Textarea 英文',
title1: 'Textarea 默認用法-禁用',
title2: 'Textarea 英文-禁用',
defaultTheme: '默認主題',
customTheme: '定制主題',
customTheme: `定制主題${harmony() ? '【暂不支持】' : ''}`,
RTL: harmony() ? 'RTL【暂不支持】' : 'RTL',
},
'en-US': {
title1: 'Textarea default',
title2: 'Textarea en-US',
title1: 'Textarea default + disabled',
title2: 'Textarea en-US + disabled',
customTheme: 'Custom Theme',
defaultTheme: 'Default Theme',
defaultTheme: `Default Theme ${harmony() ? '[Pendding]' : ''}`,
RTL: harmony() ? 'RTL[Pendding]' : 'RTL',
},
})
return (
Expand All @@ -42,7 +46,7 @@ const ConfigProviderDemo = () => {
<Demo3 />
<View className="h2">{translated.title2}</View>
<Demo4 />
<View className="h2">RTL</View>
<View className="h2">{translated.RTL}</View>
<Demo5 />
</ScrollView>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/configprovider/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NutUI-React 可以通过 [CSS 变量](https://developer.mozilla.org/zh-CN/docs/W
}
```

> @nutui/nutui-react 中带了两个主题文件 默认主题:@nutui/nutui-react/dist/styles/themes/default.css; 暗黑主题:@nutui/nutui-react/dist/styles/themes/dark.css; 如果想使用暗黑主题,可以在项目中导入暗黑主题文件。
> @nutui/nutui-react-taro 中带了两个主题文件 默认主题:@nutui/nutui-react-taro/dist/styles/themes/default.css; 暗黑主题:@nutui/nutui-react-taro/dist/styles/themes/dark.css; 如果想使用暗黑主题,可以在项目中导入暗黑主题文件。

#### 通过 ConfigProvider 覆盖

Expand Down
Loading