vue 和 uniapp 删除 数组对象中的某个指定属性 this.$delete

实例方法:
that.$delete(data,"dateTime")

代码:
getDocSource: function(data) {
    var that = this;
    //删除数组对象中的undefined,防止接口报错
    if (data.dateTime == undefined) {
        // data 是数组名 dateTime 是属性
        that.$delete(data,"dateTime")
    }
    that.$request.HttpData("/applet/scheduling/opSch", data, "POST",
        true, '加载中',
        function(res) {
            console.info(res)
            if (res.data.code == 1) {
                that.docSource = res.data.data;
                that.isloading = false;
            }
        },
        function(err) {

        })

}

  

posted @ 2022-01-07 15:36  挥不去的执念  阅读(4020)  评论(0编辑  收藏  举报