Skip to content
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
2 changes: 1 addition & 1 deletion src/packages/textarea/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const TextAreaDemo = () => {
<Demo7 />
<View className="h2">{translated.textAlign}</View>
<Demo8 />
<h2>{translated.error}</h2>
<View className="h2">{translated.error}</View>
<Demo9 />
</ScrollView>
</>
Expand Down
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/h5/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { Space, TextArea } from '@nutui/nutui-react'

const Demo1 = () => {
const Demo = () => {
return (
<Space direction="vertical">
<TextArea
Expand All @@ -20,4 +20,4 @@ const Demo1 = () => {
</Space>
)
}
export default Demo1
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/h5/demo2.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from 'react'
import { TextArea } from '@nutui/nutui-react'

const Demo2 = () => {
const Demo = () => {
const [value, setValue] = useState('')
return <TextArea value={value} onChange={(value) => setValue(value)} />
}
export default Demo2
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/h5/demo3.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react'

const Demo3 = () => {
const Demo = () => {
return <TextArea showCount maxLength={20} />
}
export default Demo3
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/h5/demo4.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react'

const Demo4 = () => {
const Demo = () => {
return <TextArea autoSize maxLength={-1} />
}
export default Demo4
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/h5/demo5.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { ConfigProvider, TextArea } from '@nutui/nutui-react'

const Demo5 = () => {
const Demo = () => {
const customTheme = {
nutuiTextareaTextCurrorColor: `red`,
nutuiTextareaLimitColor: `red`,
Expand All @@ -12,4 +12,4 @@ const Demo5 = () => {
</ConfigProvider>
)
}
export default Demo5
export default Demo
10 changes: 3 additions & 7 deletions src/packages/textarea/demos/h5/demo6.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react'

const Demo6 = () => {
return (
<>
<TextArea readOnly defaultValue="textarea只读状态" />
</>
)
const Demo = () => {
return <TextArea readOnly defaultValue="textarea只读状态" />
}
export default Demo6
export default Demo
18 changes: 8 additions & 10 deletions src/packages/textarea/demos/h5/demo7.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react'

const Demo7 = () => {
const Demo = () => {
return (
<>
<TextArea
disabled
defaultValue="textarea禁用状态"
showCount
maxLength={20}
/>
</>
<TextArea
disabled
defaultValue="textarea禁用状态"
showCount
maxLength={20}
/>
)
}
export default Demo7
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/h5/demo8.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react'

const Demo8 = () => {
const Demo = () => {
return (
<TextArea
defaultValue="文本居右"
Expand All @@ -11,4 +11,4 @@ const Demo8 = () => {
/>
)
}
export default Demo8
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/h5/demo9.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react'

const Demo8 = () => {
const Demo = () => {
return <TextArea status="error" defaultValue="输入内容错误" />
}
export default Demo8
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/taro/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { Space, TextArea } from '@nutui/nutui-react-taro'

const Demo1 = () => {
const Demo = () => {
return (
<Space direction="vertical">
<TextArea
Expand All @@ -20,4 +20,4 @@ const Demo1 = () => {
</Space>
)
}
export default Demo1
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/taro/demo2.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from 'react'
import { TextArea } from '@nutui/nutui-react-taro'

const Demo2 = () => {
const Demo = () => {
const [value, setValue] = useState('')
return <TextArea value={value} onChange={(value) => setValue(value)} />
}
export default Demo2
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/taro/demo3.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react-taro'

const Demo3 = () => {
const Demo = () => {
return <TextArea showCount maxLength={20} />
}
export default Demo3
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react-taro'

const Demo4 = () => {
const Demo = () => {
return <TextArea autoSize maxLength={-1} />
}
export default Demo4
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/taro/demo5.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { ConfigProvider, TextArea } from '@nutui/nutui-react-taro'

const Demo5 = () => {
const Demo = () => {
const customTheme = {
nutuiTextareaTextCurrorColor: `red`,
nutuiTextareaLimitColor: `red`,
Expand All @@ -12,4 +12,4 @@ const Demo5 = () => {
</ConfigProvider>
)
}
export default Demo5
export default Demo
10 changes: 3 additions & 7 deletions src/packages/textarea/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react-taro'

const Demo6 = () => {
return (
<>
<TextArea readOnly defaultValue="textarea只读状态" />
</>
)
const Demo = () => {
return <TextArea readOnly defaultValue="textarea只读状态" />
}
export default Demo6
export default Demo
18 changes: 8 additions & 10 deletions src/packages/textarea/demos/taro/demo7.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react-taro'

const Demo7 = () => {
const Demo = () => {
return (
<>
<TextArea
disabled
defaultValue="textarea禁用状态"
showCount
maxLength={20}
/>
</>
<TextArea
disabled
defaultValue="textarea禁用状态"
showCount
maxLength={20}
/>
)
}
export default Demo7
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/taro/demo8.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react-taro'

const Demo8 = () => {
const Demo = () => {
return (
<TextArea
defaultValue="文本居右"
Expand All @@ -11,4 +11,4 @@ const Demo8 = () => {
/>
)
}
export default Demo8
export default Demo
4 changes: 2 additions & 2 deletions src/packages/textarea/demos/taro/demo9.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { TextArea } from '@nutui/nutui-react-taro'

const Demo8 = () => {
const Demo = () => {
return <TextArea status="error" defaultValue="输入内容错误" />
}
export default Demo8
export default Demo
5 changes: 2 additions & 3 deletions src/packages/textarea/textarea.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import classNames from 'classnames'
import Taro from '@tarojs/taro'
import {
BaseEventOrig,
Text,
Textarea,
TextareaProps,
View,
Expand Down Expand Up @@ -151,13 +150,13 @@ export const TextArea: FunctionComponent<Partial<TextAreaProps>> = (props) => {
}
/>
{showCount && (
<Text
<View
className={classNames(`${classPrefix}-limit`, {
[`${classPrefix}-limit-disabled`]: disabled,
})}
>
{inputValue.length}/{maxLength < 0 ? 0 : maxLength}
</Text>
</View>
)}
</View>
</>
Expand Down
Loading