Vue2 v-bind:href 中如何使用过滤器

<a class="topic_title" v-bind:href="info.id|getTitleHref" v-bind:title="info.title">{{info.title}}</a>


下面是Vue的代码

 
var vm = new Vue({
        el:'#topic_list',
        data:data,
        filters:{
            getTitleHref:function(val){
                return 'https://cnodejs.org/topic/' + val 
            }
        }
    })
posted @ 2019-03-08 17:41  追梦的老头  阅读(2339)  评论(0)    收藏  举报