vue的filters的使用

<p><label>分数:</label><span>{{articleLevel.score | isNull}}</span></p>
<p><label>字频:</label><span>{{articleLevel.score_zi | isNull}}</span></p>
        filters: {
            isNull(val) {
                if (val) {
                    return Math.floor(val);
                } else {
                    return "0";
                }
            }
        },

猜你喜欢

转载自blog.csdn.net/weixin_42265852/article/details/87871505
今日推荐