vue生命周期回调方法

最近在用vue开发一个商品列表页,因需要根据请求回的字段是否有内容来显示隐藏该字段,

但因为vue异步加载导致显示隐藏方法不起作业(主要是判断条件取不到页面渲染内容),围观了vue生命周期后发现updated方法很好用

$(document).ready(function () {
    switchList();
});

//展示接口请求
function switchList() {
    $.ajax({
        type:"POST",
        timeout:3000,
        url:"../../../static/b2b-reception/data/switchList.json",
        success:function (obj) {
            lineListId.todos=obj;
            tabListId.todos=obj;
        }
    })
}

//列状展示循环渲染
var lineListId = new Vue({
    el: '#line-list',
    data: {
        todos:[]
    },
    updated: function () {
        newIcon();
    }
});
//新品标签显示隐藏
function newIcon() {
    $(".weui-mark-vip").each(function () {
        if($(this).find("span").text()==""){

            $(this).hide();
        }

        console.log($(this).find("span").text());
    })
}