wx-extend icon indicating copy to clipboard operation
wx-extend copied to clipboard

required判断object有误

Open Yrobot opened this issue 6 years ago • 0 comments

建议在required总添加对object的判断:

            required(value, param) {
                if (!that.depend(param)) {
                    return 'dependency-mismatch'
                } else if (typeof value === 'number') {
                    value = value.toString()
                } else if (typeof value === 'boolean') {
                    return !0
                } else if (Object.prototype.toString.call(value) === "[object Object]") {
                    return Object.keys(value).length;
                }

                return value.length > 0
            },

Yrobot avatar May 20 '19 11:05 Yrobot