Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vue truncate text

filters: {
        truncate: function (text, length, suffix) {
            if (text.length > length) {
                return text.substring(0, length) + suffix;
            } else {
                return text;
            }
        },
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vue #truncate #text
ADD COMMENT
Topic
Name
5+3 =