Answers for "vue slice words"

0

vue slice words

var filter = function(text, length, clamp){
    clamp = clamp || '...';
    var node = document.createElement('div');
    node.innerHTML = text;
    var content = node.textContent;
    return content.length > length ? content.slice(0, length) + clamp : content;
};

Vue.filter('truncate', filter);
Posted by: Guest on June-09-2020
0

vue slice words

{{data.content | truncate(300, '...')}}
Posted by: Guest on June-09-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language