Currently v-img will log an error to the console if the URL fails to load.
This is undesirable because sometimes the URL might be provided by a user, and we should be able to prevent console error logs.
Add a Boolean prop to VImg.ts called logErrors with a default value of true.
Change this line: image.onerror = this.onError to be: image.onerror = this.logErrors && this.onError;
@DanielStout5 maybe noErrors?
For now we're working around this with a wrapper:
import VImg from 'vuetify/lib/components/VImg'
export default VImg.extend({
name: 'VImageWrapper',
methods: {
onError() {
this.$emit('error', this.src)
}
}
})
I believe the default should be the same as the standard html components, that is no error logging by default.
Removed the log on error, still warns about decode failures though. You'll be able to turn off all warnings with Vuetify.config.silent: #10909
Most helpful comment
I believe the default should be the same as the standard
html components, that is no error logging by default.