[Vuejs]-I want to limit the maximum display length 5 items for each list (VueJS)

0👍

You can try to do something like this:

<div v-for="(Topic, Index) in FilterByTopic.FilterByTopicOptions.slice(0, (numberOfClick + 1) * 5)" 
                       v-bind:key="Topic.id"
                       class="filter-option-cnt">

data: function() {
        return {
            numberOfClick: 0,
...

methods: {
    FilterByTopic_MoreAndLess (FilterByTopic_default_limit, filters_length) {
        this.FilterByTopic_limit_by = (this.FilterByTopic_limit_by === FilterByTopic_default_limit) ? filters_length : FilterByTopic_default_limit;

        this.numberOfClick ++;
    }
}

After each click you can increment your numberOfClick by 1.

Leave a comment