Skip to content
Open
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
15 changes: 13 additions & 2 deletions src/components/number-keyboard/demos/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react'
import { List, Input, Dialog, NumberKeyboard, Toast, Button } from 'antd-mobile'
import { Button, Dialog, Input, List, NumberKeyboard, Toast } from 'antd-mobile'
import { DemoBlock } from 'demos'
import React, { useState } from 'react'

export default () => {
const [visible, setVisible] = useState<any>('')
Expand Down Expand Up @@ -66,6 +66,9 @@ export default () => {
{/* 添加 readOnly 阻止原生键盘弹出 */}
<Input placeholder='请输入内容' value={value} readOnly />
</List.Item>
<List.Item onClick={() => openKeyboard('demo7')}>
确认按钮文案支持换行
</List.Item>
</List>
</DemoBlock>
<NumberKeyboard
Expand Down Expand Up @@ -112,6 +115,14 @@ export default () => {
onDelete={onDelete}
customKey='X'
/>
<NumberKeyboard
visible={visible === 'demo7'}
onClose={actions.onClose}
onInput={actions.onInput}
onDelete={actions.onDelete}
showCloseButton={false}
confirmText={'先签约\n再转入'} // {'\n'} 可以而 '\n' 不行,后者会被转义为 '\\n'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmText 支持 ReactNode 吧,这样子直接:

confirmText={<div>...</div>}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈哈哈考虑过,不过这样无障碍标签就没法弄了,又要新开 props

从最小变更角度这么改最好,而且我们目前业务需求上也只是想要文案换行,暂无更多复杂样式

/>
</>
)
}
1 change: 1 addition & 0 deletions src/components/number-keyboard/number-keyboard.less
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
height: 144px;
font-size: 16px;
border: none;
white-space: pre-line;
}
}
}
Loading