From bf0e1ce33d13081f73118d776f3c09a438d8b129 Mon Sep 17 00:00:00 2001 From: xiaoyatong <84436086+xiaoyatong@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:01:14 +0800 Subject: [PATCH] fix: space harmony (#2817) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: space harmony * fix: 改用 space 标签 --- .../nutui-taro-demo/src/pages/index/index.tsx | 48 ++++++++++++------- src/packages/space/demo.taro.tsx | 28 +++-------- src/packages/space/demo.tsx | 25 +++------- src/packages/space/demos/h5/demo1.tsx | 14 +++--- src/packages/space/demos/h5/demo2.tsx | 20 ++++---- src/packages/space/demos/h5/demo3.tsx | 14 +++--- src/packages/space/demos/h5/demo4.tsx | 26 +++++----- src/packages/space/demos/h5/demo5.tsx | 34 ++++++------- src/packages/space/demos/h5/demo6.tsx | 34 ++++++------- src/packages/space/demos/taro/demo1.tsx | 14 +++--- src/packages/space/demos/taro/demo2.tsx | 20 ++++---- src/packages/space/demos/taro/demo3.tsx | 14 +++--- src/packages/space/demos/taro/demo4.tsx | 26 +++++----- src/packages/space/demos/taro/demo5.tsx | 35 ++++++-------- src/packages/space/demos/taro/demo6.tsx | 35 ++++++-------- 15 files changed, 185 insertions(+), 202 deletions(-) diff --git a/packages/nutui-taro-demo/src/pages/index/index.tsx b/packages/nutui-taro-demo/src/pages/index/index.tsx index fbe4b26b40..7e4bc3ecb6 100644 --- a/packages/nutui-taro-demo/src/pages/index/index.tsx +++ b/packages/nutui-taro-demo/src/pages/index/index.tsx @@ -1,5 +1,16 @@ import Taro from '@tarojs/taro' -import { View, Image, Swiper, SwiperItem, Text, ScrollView, Button, Input, Video } from '@tarojs/components' +import { + View, + Image, + Swiper, + SwiperItem, + Text, + ScrollView, + Button, + Input, + Video, + Textarea, +} from '@tarojs/components' import pkg from '@/packages/../config.json' import packageJson from '@/packages/../../package.json' import './index.scss' @@ -8,9 +19,8 @@ import './index.scss' const navs = pkg.nav // console.log(navs) - // hack taro load button xml -console.log(Button, Input, Video,Image, Swiper, SwiperItem, ) +console.log(Button, Input, Video, Image, Swiper, SwiperItem, Textarea) // try { // console.log('xxx', Schema) @@ -39,37 +49,39 @@ const Index = () => { } return ( - - + + - - NutUI React - + + NutUI React + 京东风格的轻量级小程序组件库 React 版 - - v{packageJson?.version} + + + v{packageJson?.version} + - + {navs.map((nav) => ( - + {nav.enName === 'dataentry' ? null : ( - {nav.name} + {nav.name} )} - + {nav.packages.map((com) => com.show && com.taro && com.version === '3.0.0' ? ( gotoNext(com.name, nav.enName)} > diff --git a/src/packages/space/demo.taro.tsx b/src/packages/space/demo.taro.tsx index fe9d006da6..2f436f557a 100644 --- a/src/packages/space/demo.taro.tsx +++ b/src/packages/space/demo.taro.tsx @@ -1,13 +1,12 @@ import React from 'react' import Taro from '@tarojs/taro' import { ScrollView, View } from '@tarojs/components' -import { Cell } from '@nutui/nutui-react-taro' import { useTranslate } from '@/sites/assets/locale/taro' import Header from '@/sites/components/header' import Demo1 from './demos/taro/demo1' import Demo2 from './demos/taro/demo2' import Demo3 from './demos/taro/demo3' -// import Demo4 from './demos/taro/demo4' +import Demo4 from './demos/taro/demo4' import Demo5 from './demos/taro/demo5' import Demo6 from './demos/taro/demo6' @@ -44,30 +43,17 @@ const SpaceDemo = () => {
{translated.basic} - - - + {translated.wrap} - - - + {translated.direction} - - - + {translated.spaceGap} - {/* @TODO ConfigProvider 暂不支持 */} - {/* - - */} + {translated.mainAxisAlign} - - - + {translated.crossAxisAlign} - - - + ) diff --git a/src/packages/space/demo.tsx b/src/packages/space/demo.tsx index 929a86e1b6..af75de0352 100644 --- a/src/packages/space/demo.tsx +++ b/src/packages/space/demo.tsx @@ -1,5 +1,4 @@ import React from 'react' -import Cell from '@/packages/cell' import { useTranslate } from '@/sites/assets/locale' import Demo1 from './demos/h5/demo1' import Demo2 from './demos/h5/demo2' @@ -40,29 +39,17 @@ const SpaceDemo = () => { <>

{translated.basic}

- - - +

{translated.wrap}

- - - +

{translated.direction}

- - - +

{translated.spaceGap}

- - - +

{translated.mainAxisAlign}

- - - +

{translated.crossAxisAlign}

- - - +
) diff --git a/src/packages/space/demos/h5/demo1.tsx b/src/packages/space/demos/h5/demo1.tsx index 6e0d753b70..bfb1140102 100644 --- a/src/packages/space/demos/h5/demo1.tsx +++ b/src/packages/space/demos/h5/demo1.tsx @@ -1,13 +1,15 @@ import React from 'react' -import { Space, Button } from '@nutui/nutui-react' +import { Space, Button, Cell } from '@nutui/nutui-react' const Demo1 = () => { return ( - - - - - + + + + + + + ) } export default Demo1 diff --git a/src/packages/space/demos/h5/demo2.tsx b/src/packages/space/demos/h5/demo2.tsx index d9d8365c05..aa7daaee72 100644 --- a/src/packages/space/demos/h5/demo2.tsx +++ b/src/packages/space/demos/h5/demo2.tsx @@ -1,16 +1,18 @@ import React from 'react' -import { Space, Button } from '@nutui/nutui-react' +import { Space, Button, Cell } from '@nutui/nutui-react' const Demo2 = () => { return ( - - - - - - - - + + + + + + + + + + ) } export default Demo2 diff --git a/src/packages/space/demos/h5/demo3.tsx b/src/packages/space/demos/h5/demo3.tsx index f23a856f97..60f1a4ce41 100644 --- a/src/packages/space/demos/h5/demo3.tsx +++ b/src/packages/space/demos/h5/demo3.tsx @@ -1,13 +1,15 @@ import React from 'react' -import { Space, Button } from '@nutui/nutui-react' +import { Space, Button, Cell } from '@nutui/nutui-react' const Demo3 = () => { return ( - - - - - + + + + + + + ) } export default Demo3 diff --git a/src/packages/space/demos/h5/demo4.tsx b/src/packages/space/demos/h5/demo4.tsx index a41810d5f6..15f1aff98a 100644 --- a/src/packages/space/demos/h5/demo4.tsx +++ b/src/packages/space/demos/h5/demo4.tsx @@ -1,19 +1,21 @@ import React from 'react' -import { Space, Button, ConfigProvider } from '@nutui/nutui-react' +import { Space, Button, ConfigProvider, Cell } from '@nutui/nutui-react' const Demo4 = () => { return ( - - - - - - - + + + + + + + + + ) } export default Demo4 diff --git a/src/packages/space/demos/h5/demo5.tsx b/src/packages/space/demos/h5/demo5.tsx index 58c1a367cf..9c3395a617 100644 --- a/src/packages/space/demos/h5/demo5.tsx +++ b/src/packages/space/demos/h5/demo5.tsx @@ -1,26 +1,22 @@ import React from 'react' -import { Space, Button } from '@nutui/nutui-react' +import { Space, Button, Cell } from '@nutui/nutui-react' const Demo5 = () => { return ( - - -
- - -
-
- - - -
-
+ + + + + + + + + + + + + + ) } export default Demo5 diff --git a/src/packages/space/demos/h5/demo6.tsx b/src/packages/space/demos/h5/demo6.tsx index 8c64eaa561..e8020e71d5 100644 --- a/src/packages/space/demos/h5/demo6.tsx +++ b/src/packages/space/demos/h5/demo6.tsx @@ -1,26 +1,22 @@ import React from 'react' -import { Space, Button } from '@nutui/nutui-react' +import { Space, Button, Cell } from '@nutui/nutui-react' const Demo6 = () => { return ( - - -
- - -
-
- - - -
-
+ + + + + + + + + + + + + + ) } export default Demo6 diff --git a/src/packages/space/demos/taro/demo1.tsx b/src/packages/space/demos/taro/demo1.tsx index f8adc517ff..1b7d5c8513 100644 --- a/src/packages/space/demos/taro/demo1.tsx +++ b/src/packages/space/demos/taro/demo1.tsx @@ -1,13 +1,15 @@ import React from 'react' -import { Space, Button } from '@nutui/nutui-react-taro' +import { Cell, Space, Button } from '@nutui/nutui-react-taro' const Demo1 = () => { return ( - - - - - + + + + + + + ) } export default Demo1 diff --git a/src/packages/space/demos/taro/demo2.tsx b/src/packages/space/demos/taro/demo2.tsx index 255c314f37..216f29f199 100644 --- a/src/packages/space/demos/taro/demo2.tsx +++ b/src/packages/space/demos/taro/demo2.tsx @@ -1,16 +1,18 @@ import React from 'react' -import { Space, Button } from '@nutui/nutui-react-taro' +import { Space, Button, Cell } from '@nutui/nutui-react-taro' const Demo2 = () => { return ( - - - - - - - - + + + + + + + + + + ) } export default Demo2 diff --git a/src/packages/space/demos/taro/demo3.tsx b/src/packages/space/demos/taro/demo3.tsx index f5dc31abde..6dcb8dc942 100644 --- a/src/packages/space/demos/taro/demo3.tsx +++ b/src/packages/space/demos/taro/demo3.tsx @@ -1,13 +1,15 @@ import React from 'react' -import { Space, Button } from '@nutui/nutui-react-taro' +import { Space, Button, Cell } from '@nutui/nutui-react-taro' const Demo3 = () => { return ( - - - - - + + + + + + + ) } export default Demo3 diff --git a/src/packages/space/demos/taro/demo4.tsx b/src/packages/space/demos/taro/demo4.tsx index e68be306e6..3e4b8a6511 100644 --- a/src/packages/space/demos/taro/demo4.tsx +++ b/src/packages/space/demos/taro/demo4.tsx @@ -1,19 +1,21 @@ import React from 'react' -import { Space, Button, ConfigProvider } from '@nutui/nutui-react-taro' +import { Space, Button, ConfigProvider, Cell } from '@nutui/nutui-react-taro' const Demo4 = () => { return ( - - - - - - - + + + + + + + + + ) } export default Demo4 diff --git a/src/packages/space/demos/taro/demo5.tsx b/src/packages/space/demos/taro/demo5.tsx index 6c037bab91..c55b48554f 100644 --- a/src/packages/space/demos/taro/demo5.tsx +++ b/src/packages/space/demos/taro/demo5.tsx @@ -1,27 +1,22 @@ import React from 'react' -import { View } from '@tarojs/components' -import { Space, Button } from '@nutui/nutui-react-taro' +import { Space, Button, Cell } from '@nutui/nutui-react-taro' const Demo5 = () => { return ( - - - - - - - - - - - - + + + + + + + + + + + + + + ) } export default Demo5 diff --git a/src/packages/space/demos/taro/demo6.tsx b/src/packages/space/demos/taro/demo6.tsx index e37fcbebb7..52de34e351 100644 --- a/src/packages/space/demos/taro/demo6.tsx +++ b/src/packages/space/demos/taro/demo6.tsx @@ -1,27 +1,22 @@ import React from 'react' -import { View } from '@tarojs/components' -import { Space, Button } from '@nutui/nutui-react-taro' +import { Space, Button, Cell } from '@nutui/nutui-react-taro' const Demo6 = () => { return ( - - - - - - - - - - - - + + + + + + + + + + + + + + ) } export default Demo6