A filter for Vuejs to truncate string
Available through npm as vue-truncate-filter
: npm install vue-truncate-filter --save
var VueTruncate = require('vue-truncate-filter')
Vue.use(VueTruncate)
<script>
tag when you have Vue already included globally. It will automatically install itself, and will add a global VueTruncate
. {{ text | truncate 100 '....' }}
{{ text | truncate(100) }}
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.