1.0.1 • Published 7 years ago

clamp-lines v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

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>
1.0.1

7 years ago

1.0.0

7 years ago