Reputation: 481
I've been running into a warning that I want to hide/fix. I read you can hide warnings using Vue.config.ignoredElements
, and have added the code below in my main.js
file:
Vue.config.ignoredElements = [
'slot v-bind without argument expects an Object',
'Expected Object, got Array',
'v-bind without argument expects an Object or Array value'
]
Is there a specific option I need to add? or a better way to fix this problem?
This issue might be related: https://github.com/vuejs/vue/issues/6677
Upvotes: 0
Views: 2777
Reputation: 29132
I think you've misunderstood. ignoredElements
solves a very specific problem.
Typically when Vue is rendering it comes across 3 types of element:
<div>
.<template>
or <slot>
.<v-select>
.Vue has a list of HTML elements hard-coded so that it can identify the first group. See:
If it comes across an element with a name it doesn't recognise it will log an error. Most of the time that's fine but occasionally you might need Vue to treat an unknown element just like a plain HTML element. That can be achieved by adding it to ignoredElements
. See https://v2.vuejs.org/v2/api/#ignoredElements for more details.
It is not used to suppress warning messages more generally.
You mentioned three messages:
In all cases these mean that there's a bug in your code. You shouldn't be trying to suppress these warnings, you should be fixing the bugs.
Upvotes: 3