use filters in v for loop [ Working Example ]

    By: Thad Mertz
    3 years ago

    It is easy not that hard have a look

    <li class="nav-item" v-for="post in posts"  :key="post.id">
      <router-link :to="`/post/${post.category_name}`|lowerCase">
          {post.category_name|lowerCase}
      </router-link>
    </li>
    

    In code above we are using filter lowerCase on Post Category Variable.

    Filter looks like this

    lowerCase(value){
        return value.toLowerCase();
    }
    

    So this out puts all category names in lower case. Hope it helps