vue过滤出去不带某个字段的对象

 其中data.SC为一个数组

  dsc = data.SC.filter((item)=>{

            return  item.hasOwnProperty('message_name'); 

         })

使用hasOwnProperty这个方法即可,object.hasOwnProperty()  

猜你喜欢

转载自blog.csdn.net/weixin_43703816/article/details/131051214