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

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


下面是Vue的代码

 
var vm = new Vue({
        el:'#topic_list',
        data:data,
        filters:{
            getTitleHref:function(val){ return 'https://cnodejs.org/topic/' + val } } })

转载于:https://www.cnblogs.com/web-chuanfa/p/10497223.html

你可能感兴趣的:(Vue2 v-bind:href 中如何使用过滤器)