Package Exports
- vue-truncate-collapsed
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-truncate-collapsed) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vue-truncate-collapsed
A simple Vue 2 Component that's truncate your text and adds a "Read Me/Show Less" clickable.
Getting Started
NPM
$ npm install vue-truncate-collapsed --save
Clone this repo
Clone or download the component and save in your own project.
Installing
ES6
import truncate from 'vue-truncate-collapsed';
// or
import { truncate } from 'vue-truncate-collapsed';
new Vue({
components: {
truncate
}
})
CommonJS
var truncate = require('vue-truncate-collapsed');
new Vue({
components: {
'truncate': truncate
}
})
USAGE
<truncate clamp="..." length="90" less="Show Less" text="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam modi consequuntur quis porro explicabo iusto repudiandae odio nobis, assumenda iure totam, eum expedita quae at nostrum excepturi corrupti unde et."></truncate>
Attributes
Option | Default | Type | Description |
---|---|---|---|
text | no default value | string | The text that will be truncated. |
length | 100 | number | Length of text after truncate. |
clamp | Read More | string | Link that will be after the text with a link to expand. |
less | Show Less | string | Link that will be after the text when it's expand, when click text collapses. |
License
This project is licensed under the MIT License - see the LICENSE.md file for details