forked from jdf2e/nutui-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(textarea): demo拆解与规范 (jdf2e#2132)
- Loading branch information
1 parent
aeb6e62
commit b7be8ca
Showing
22 changed files
with
282 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react' | ||
|
||
const Demo1 = () => { | ||
return ( | ||
<TextArea | ||
defaultValue="基础用法" | ||
className="text-1" | ||
style={{ fontSize: '12px' }} | ||
onChange={(value) => console.log('change', value)} | ||
onBlur={() => console.log('blur')} | ||
onFocus={() => console.log('focus')} | ||
/> | ||
) | ||
} | ||
export default Demo1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React, { useState } from 'react' | ||
import { TextArea } from '@nutui/nutui-react' | ||
|
||
const Demo2 = () => { | ||
const [value, setValue] = useState('') | ||
return <TextArea value={value} onChange={(value) => setValue(value)} /> | ||
} | ||
export default Demo2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react' | ||
|
||
const Demo3 = () => { | ||
return <TextArea showCount maxLength={20} /> | ||
} | ||
export default Demo3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react' | ||
|
||
const Demo4 = () => { | ||
return <TextArea rows={1} autoSize /> | ||
} | ||
export default Demo4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react' | ||
import { ConfigProvider, TextArea } from '@nutui/nutui-react' | ||
|
||
const Demo5 = () => { | ||
const customTheme = { | ||
nutuiTextareaTextCurrorColor: `red`, | ||
nutuiTextareaLimitColor: `red`, | ||
} | ||
return ( | ||
<ConfigProvider theme={customTheme}> | ||
<TextArea showCount maxLength={20} /> | ||
</ConfigProvider> | ||
) | ||
} | ||
export default Demo5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react' | ||
|
||
const Demo6 = () => { | ||
return ( | ||
<> | ||
<TextArea readOnly defaultValue="textarea只读状态" /> | ||
</> | ||
) | ||
} | ||
export default Demo6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react' | ||
|
||
const Demo7 = () => { | ||
return ( | ||
<> | ||
<TextArea | ||
disabled | ||
defaultValue="textarea禁用状态" | ||
showCount | ||
maxLength={20} | ||
/> | ||
</> | ||
) | ||
} | ||
export default Demo7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react' | ||
|
||
const Demo8 = () => { | ||
return ( | ||
<TextArea | ||
defaultValue="文本居右" | ||
style={{ | ||
textAlign: 'right', | ||
}} | ||
/> | ||
) | ||
} | ||
export default Demo8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TextArea } from '@nutui/nutui-react-taro' | ||
import React from 'react' | ||
|
||
const Demo1 = () => { | ||
return ( | ||
<TextArea | ||
defaultValue="基础用法" | ||
className="text-1" | ||
style={{ fontSize: '12px' }} | ||
onChange={(value) => console.log('change', value)} | ||
onBlur={() => console.log('blur')} | ||
onFocus={() => console.log('focus')} | ||
/> | ||
) | ||
} | ||
export default Demo1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React, { useState } from 'react' | ||
import { TextArea } from '@nutui/nutui-react-taro' | ||
|
||
const Demo2 = () => { | ||
const [value, setValue] = useState('') | ||
return <TextArea value={value} onChange={(value) => setValue(value)} /> | ||
} | ||
export default Demo2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react-taro' | ||
|
||
const Demo3 = () => { | ||
return <TextArea showCount maxLength={20} /> | ||
} | ||
export default Demo3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react-taro' | ||
|
||
const Demo4 = () => { | ||
return <TextArea rows={1} autoSize /> | ||
} | ||
export default Demo4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react' | ||
import { ConfigProvider, TextArea } from '@nutui/nutui-react-taro' | ||
|
||
const Demo5 = () => { | ||
const customTheme = { | ||
nutuiTextareaTextCurrorColor: `red`, | ||
nutuiTextareaLimitColor: `red`, | ||
} | ||
return ( | ||
<ConfigProvider theme={customTheme}> | ||
<TextArea showCount maxLength={20} /> | ||
</ConfigProvider> | ||
) | ||
} | ||
export default Demo5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react-taro' | ||
|
||
const Demo6 = () => { | ||
return ( | ||
<> | ||
<TextArea readOnly defaultValue="textarea只读状态" /> | ||
</> | ||
) | ||
} | ||
export default Demo6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react-taro' | ||
|
||
const Demo7 = () => { | ||
return ( | ||
<> | ||
<TextArea | ||
disabled | ||
defaultValue="textarea禁用状态" | ||
showCount | ||
maxLength={20} | ||
/> | ||
</> | ||
) | ||
} | ||
export default Demo7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import { TextArea } from '@nutui/nutui-react-taro' | ||
|
||
const Demo8 = () => { | ||
return ( | ||
<TextArea | ||
defaultValue="文本居右" | ||
style={{ | ||
textAlign: 'right', | ||
}} | ||
/> | ||
) | ||
} | ||
export default Demo8 |
Oops, something went wrong.