perf(@vant/lazyload): reduce production log

This commit is contained in:
chenjiahan
2021-09-24 10:48:24 +08:00
committed by neverland
parent 00b1568887
commit 33d7aa8f1a
3 changed files with 22 additions and 8 deletions
+8 -2
View File
@@ -472,8 +472,14 @@ export default function () {
// value is object
if (isObject(value)) {
if (!value.src && !this.options.silent)
console.error('Vue Lazyload warning: miss src with ' + value);
if (
process.env.NODE_ENV !== 'production' &&
!value.src &&
!this.options.silent
) {
console.error('[@vant/lazyload] miss src with ' + value);
}
({ src } = value);
loading = value.loading || this.options.loading;
error = value.error || this.options.error;