Two files are involved in this issue, one is a Vue file and the other is a JavaScript file. The JavaScript file contains an array and the problem is being described in the console. Additionally, there may be an issue with items as sometimes the same error is encountered for them as well. Below is the code snippet: enter image description here https://i.sstatic.net/AYKAK.png
JavaScript file:
import Vue from "vue";
new Vue ({
el: 'TopHead',
show:false
});
Vue file named "TopHead":
<transition name="fade" mode="out-in">
<i class="material-icons menu" v-if="!show" @click="switchShow" key="menu">menu</i>
<i class="material-icons clear" v-else @click="switchShow" key="clear">clear</i>
</transition>
<transition name="fade">
<ul v-if="show">
<li v-for="item in items" :key="item"><a :href="item.url">{{ item.name }}</a></li>
</ul>
</transition>
<script>
export default {
data: function () {
return {
items: [
{name: 'Yarn', url: '#'},
{name: 'Needles', url: '#'},
{name: 'Hooks', url: '#'},
{name: 'Accessories', url: '#'},
{name: 'Gift Certificates', url: '#'},
{name: 'Patterns and Descriptions', url: '#'},
{name: 'Models', url: '#'},
],
show: false
}
},
name: 'TopHead',
methods: {
switchShow() {
this.show = !this.show;
}
}
}
</script>