All Projects → imcvampire → vue-truncate-filter

imcvampire / vue-truncate-filter

Licence: MIT license
A filter for Vuejs to truncate string

Programming Languages

javascript
184084 projects - #8 most used programming language

vue-truncate-filter

Greenkeeper badge

A filter for Vuejs to truncate string

Install:

CommonJS

Available through npm as vue-truncate-filter: npm install vue-truncate-filter --save

var VueTruncate = require('vue-truncate-filter')
Vue.use(VueTruncate)

Direct include

  • You can also directly include it with a <script> tag when you have Vue already included globally. It will automatically install itself, and will add a global VueTruncate.

Usage:

Vue 1.x

 {{ text | truncate 100 '....' }}

Vue 2.x

 {{ text | truncate(100) }}

Params:

  • length (Number): Text will be truncated if it's length is more than this param.

  • clamp (String) (default: ...): It will be added to end of text if it's truncated.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].