Ninja Programmers Mindmeld

    clamp-lines

    1.0.1 • Public • Published

    clamp-lines 多行文本省略插件

    Browser compatibility

    Supports IE8+ / Android4+ / IOS6+ / etc. Almost all of the common browsers on PC / mobile device.

    Installation

    You can install multi-clamp from npm:

    npm install clamp-lines --save

    Usage

    Import clamp-lines.

    import ClampLines from 'clamp-lines';

    Just new the clamp-lines constructor.

    <div id="text">text,ClampLines,ClampLines,ClampLines,ClampLines</div>
     
    <script>
    new ClampLines(document.getElementById('text'), {
      ellipsis: '...',
      clamp: 3
    });
    </script> 

    Keywords

    Install

    npm i clamp-lines

    DownloadsWeekly Downloads

    0

    Version

    1.0.1

    License

    ISC

    Last publish

    Collaborators

    • qinjm8888