Skip to content

Commit 3b03fa0

Browse files
authored
fix(configprovider): 调整demo,修复web h5 下引入不一致问题,修复文档 (#3244)
1 parent bab9aa7 commit 3b03fa0

File tree

13 files changed

+32
-32
lines changed

13 files changed

+32
-32
lines changed

src/packages/configprovider/demo.taro.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ import { useTranslate } from '@/sites/assets/locale/taro'
1111
const ConfigProviderDemo = () => {
1212
const [translated] = useTranslate({
1313
'zh-CN': {
14-
text: 'Textarea 中文与英文',
14+
text: 'Pagination 中文与英文',
1515
theme: '默认主题与定制主题',
1616
RTL: harmony() ? 'RTL【暂不支持】' : 'RTL',
1717
},
1818
'zh-TW': {
19-
text: 'Textarea 中文与英文',
19+
text: 'Pagination 中文与英文',
2020
theme: '默認主題与定制主題',
2121
RTL: harmony() ? 'RTL【暂不支持】' : 'RTL',
2222
},
2323
'en-US': {
24-
text: 'Textarea zh-CN and en-US',
24+
text: 'Pagination zh-CN and en-US',
2525
theme: 'Default Theme And Custom Theme',
2626
RTL: harmony() ? 'RTL[Pendding]' : 'RTL',
2727
},

src/packages/configprovider/demo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import { useTranslate } from '@/sites/assets/locale'
77
const ConfigProviderDemo = () => {
88
const [translated] = useTranslate({
99
'zh-CN': {
10-
text: 'Textarea 中文与英文',
10+
text: 'Pagination 中文与英文',
1111
theme: '默认主题与定制主题',
1212
},
1313
'zh-TW': {
14-
text: 'Textarea 中文与英文',
14+
text: 'Pagination 中文与英文',
1515
theme: '默認主題与定制主題',
1616
},
1717
'en-US': {
18-
text: 'Textarea zh-CN and en-US',
18+
text: 'Pagination zh-CN and en-US',
1919
theme: 'Default Theme And Custom Theme',
2020
},
2121
})

src/packages/configprovider/demos/h5/demo2.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import React from 'react'
2-
import { ConfigProvider, TextArea, Cell } from '@nutui/nutui-react'
3-
import enUS from '@nutui/nutui-react/dist/es/locale/en-US'
2+
import { ConfigProvider, Pagination, Cell } from '@nutui/nutui-react'
3+
import enUS from '@nutui/nutui-react/dist/es/locales/en-US'
44

55
const Demo = () => {
66
return (
77
<>
88
<ConfigProvider>
99
<Cell>
10-
<TextArea disabled showCount maxLength={20} />
10+
<Pagination total={20} pageSize={5} />
1111
</Cell>
1212
</ConfigProvider>
1313
<ConfigProvider locale={enUS}>
1414
<Cell>
15-
<TextArea disabled showCount maxLength={20} />
15+
<Pagination total={20} pageSize={5} />
1616
</Cell>
1717
</ConfigProvider>
1818
</>

src/packages/configprovider/demos/taro/demo2.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import React from 'react'
2-
import { ConfigProvider, TextArea, Cell } from '@nutui/nutui-react-taro'
2+
import { ConfigProvider, Pagination, Cell } from '@nutui/nutui-react-taro'
33
import enUS from '@nutui/nutui-react-taro/dist/es/locales/en-US'
44

55
const Demo = () => {
66
return (
77
<>
88
<ConfigProvider>
99
<Cell>
10-
<TextArea disabled showCount maxLength={20} />
10+
<Pagination total={20} pageSize={5} />
1111
</Cell>
1212
</ConfigProvider>
1313
<ConfigProvider locale={enUS}>
1414
<Cell>
15-
<TextArea disabled showCount maxLength={20} />
15+
<Pagination total={20} pageSize={5} />
1616
</Cell>
1717
</ConfigProvider>
1818
</>

src/packages/configprovider/doc.en-US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ You can override these CSS variables directly in your code, and the styling of t
2424
/* After you add this style, the Primary Button turns green */
2525
:root {
2626
--nutui-color-primary: green;
27-
--nutui-color-primary-stop1: green;
28-
--nutui-color-primary-stop2: green;
27+
--nutui-color-primary-stop-1: green;
28+
--nutui-color-primary-stop-2: green;
2929
}
3030
```
3131

src/packages/configprovider/doc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ NutUI-React 可以通过 [CSS 变量](https://developer.mozilla.org/zh-CN/docs/W
2424
/* 添加这段样式后,Primary Button 会变成绿色 */
2525
:root {
2626
--nutui-color-primary: green;
27-
--nutui-color-primary-stop1: green;
28-
--nutui-color-primary-stop2: green;
27+
--nutui-color-primary-stop-1: green;
28+
--nutui-color-primary-stop-2: green;
2929
}
3030
```
3131

src/packages/configprovider/doc.taro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ NutUI-React 可以通过 [CSS 变量](https://developer.mozilla.org/zh-CN/docs/W
2424
/* 添加这段样式后,Primary Button 会变成绿色 */
2525
:root {
2626
--nutui-color-primary: green;
27-
--nutui-color-primary-stop1: green;
28-
--nutui-color-primary-stop2: green;
27+
--nutui-color-primary-stop-1: green;
28+
--nutui-color-primary-stop-2: green;
2929
}
3030
```
3131

src/packages/configprovider/doc.zh-TW.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ NutUI-React 可以通過 \[CSS 變數\](<https://developer.mozilla.org/zh-CN/d
2424
/* 添加這段樣式后,Primary Button 會變成綠色 */
2525
:root {
2626
--nutui-color-primary: green;
27-
--nutui-color-primary-stop1: green;
28-
--nutui-color-primary-stop2: green;
27+
--nutui-color-primary-stop-1: green;
28+
--nutui-color-primary-stop-2: green;
2929
}
3030
```
3131

src/sites/sites-react/doc/docs/react/theme-react.en-US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Create a new 'SCSS' file 'custom_theme.scss' in your local project.
2828
```scss
2929
// Dominant tone
3030
$color-primary: #fa2c19;
31-
$color-primary-end: #fa6419;
31+
$color-primary-stop-1: #fa6419;
3232
...
3333
```
3434

@@ -62,7 +62,7 @@ export default defineConfig({
6262
loader: 'sass-loader',
6363
options: {
6464
// Note: The option name is different for different versions of ass-loader. For details, see the corresponding version document of ass-loader
65-
data: `@import "./assets/custom_theme.scss";@import "@nutui/nutui/dist/styles/variables.scss";`,
65+
data: `@import "./assets/custom_theme.scss";@import "@nutui/nutui-react/dist/styles/variables.scss";`,
6666
}
6767
}
6868
]

src/sites/sites-react/doc/docs/react/theme-react.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ NutUI-React 支持灵活的样式定制,满足多种视觉业务和品牌需
2525
```scss
2626
// 主色调
2727
$color-primary: #fa2c19;
28-
$color-primary-end: #fa6419;
28+
$color-primary-stop-1: #fa6419;
2929
...
3030
```
3131

@@ -59,7 +59,7 @@ export default defineConfig({
5959
loader: 'sass-loader',
6060
options: {
6161
// 注意:在 sass-loader 不同版本,这个选项名是 是不一样的,具体可参考 sass-loader对应的版本文档
62-
data: `@import "./assets/custom_theme.scss";@import "@nutui/nutui/dist/styles/variables.scss";`,
62+
data: `@import "./assets/custom_theme.scss";@import "@nutui/nutui-react/dist/styles/variables.scss";`,
6363
}
6464
}
6565
]

src/sites/sites-react/doc/docs/taro/theme-react.en-US.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Create a new 'SCSS' file 'custom_theme.scss' in your local project.
2828
```scss
2929
// Dominant tone
3030
$color-primary: #fa2c19;
31-
$color-primary-end: #fa6419;
31+
$color-primary-stop-1: #fa6419;
3232
...
3333
```
3434

@@ -45,7 +45,7 @@ export default defineConfig({
4545
css: {
4646
preprocessorOptions: {
4747
scss: {
48-
additionalData: `@import "@nutui/nutui-react/dist/styles/variables.scss";@import "./your/custom_theme.scss";`,
48+
additionalData: `@import "@nutui/nutui-react-taro/dist/styles/variables.scss";@import "./your/custom_theme.scss";`,
4949
},
5050
},
5151
},
@@ -62,7 +62,7 @@ export default defineConfig({
6262
loader: 'sass-loader',
6363
options: {
6464
// Note: The option name is different for different versions of ass-loader. For details, see the corresponding version document of ass-loader
65-
data: `@import "./assets/custom_theme.scss";@import "@nutui/nutui/dist/styles/variables.scss";`,
65+
data: `@import "./assets/custom_theme.scss";@import "@nutui/nutui-react-taro/dist/styles/variables.scss";`,
6666
}
6767
}
6868
]

src/sites/sites-react/doc/docs/taro/theme-react.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ NutUI-React 支持灵活的样式定制,满足多种视觉业务和品牌需
2525
```scss
2626
// 主色调
2727
$color-primary: #fa2c19;
28-
$color-primary-end: #fa6419;
28+
$color-primary-stop-1: #fa6419;
2929
...
3030
```
3131

@@ -42,7 +42,7 @@ export default defineConfig({
4242
css: {
4343
preprocessorOptions: {
4444
scss: {
45-
additionalData: `@import "@nutui/nutui-react/dist/styles/variables.scss";@import "./your/custom_theme.scss";`,
45+
additionalData: `@import "@nutui/nutui-react-taro/dist/styles/variables.scss";@import "./your/custom_theme.scss";`,
4646
},
4747
},
4848
},
@@ -59,7 +59,7 @@ export default defineConfig({
5959
loader: 'sass-loader',
6060
options: {
6161
// 注意:在 sass-loader 不同版本,这个选项名是 是不一样的,具体可参考 sass-loader对应的版本文档
62-
data: `@import "./assets/custom_theme.scss";@import "@nutui/nutui/dist/styles/variables.scss";`,
62+
data: `@import "./assets/custom_theme.scss";@import "@nutui/nutui-react-taro/dist/styles/variables.scss";`,
6363
}
6464
}
6565
]

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@/*": [
2828
"src/*"
2929
],
30-
"@nutui/nutui-react/dist/es/locale/en-US": [
30+
"@nutui/nutui-react/dist/es/locales/en-US": [
3131
"src/locales/en-US.ts"
3232
],
3333
"@nutui/nutui-react-taro/dist/es/locales/en-US": [

0 commit comments

Comments
 (0)