@gaopeng123/rc-br
TypeScript icon, indicating that this package has built-in type declarations

1.3.5 • Public • Published

rc-br

换行插件,将textArea数据换行展示

Br 换行组件

参数

参数 属性 默认值
text 需要处理和解析的文本 string|Arraystring|Array
render 额外处理文本 ()=> ReactNode | string
maxRow 最多显示行数,大于该行数显示更多 number
maxLength 最多显示字符数,大于该行数显示更多 number
handleMoreClick 点击更多的回调 (rows: Array) => void
onMoreClick 点击更多时的函数,传入该函数冲点更多逻辑,需要自己实现更多 (rows: Array) => void

Usage

demo

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import {RcBr} from "../src";

const App = () => {
    return (
        <RcBr
            text={'aaaaaa\nbbbbbbbbb\ncccccc'}
            render={(row) => {
                return <span>{row}</span>
            }}
        />
    );
};

ReactDOM.render(<App/>, document.getElementById('root'));

Readme

Keywords

Package Sidebar

Install

npm i @gaopeng123/rc-br

Weekly Downloads

0

Version

1.3.5

License

MIT

Unpacked Size

20.9 kB

Total Files

10

Last publish

Collaborators

  • gaopeng123