A
A
Alexander Ivanov2018-02-05 20:58:14
Vue.js
Alexander Ivanov, 2018-02-05 20:58:14

How to use filters in VUE template?

https://github.com/vuejs/vue/issues/2756 - there is one suggestion here but doesn't work in my case.
using VUE with laravel

//item in posts | findBy 'name - подобный вариант не пашет при использовании файлов с типом blabla.vue 
<template>
     <li v-for="item in posts | findBy 'name'">{{item.name}}</li>
</template>
<script>

    export default {
        data(){
            return{
                btn_txt: "Искать",
                posts: []
            }
        },
... 
        methods: {
            onClick: function () {
                console.log('aasdasdsd');
            }
        }
    }
</script>

How to use filters via export in Vue?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-02-05
@cimonlebedev

You don't need a filter here, but a computed property or method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question