Answer the question
In order to leave comments, you need to log in
How do I use data in App.vue?
Hello everybody.
The question is probably quite simple, but I do not understand what the problem is ...
Here is the code: (this is the App.vue file )
<template>
<div id="app">
<router-view/>
<VuePopup
v-if="this.showPopup"
@closePopup="closePopup()"
/>
</div>
</template>
<script>
import VuePopup from './components/VuePopup'
export default {
name: 'App',
date(){
return {
showPopup: true,
}
},
components: {
VuePopup
},
methods: {
closePopup(){
this.showPopup = false
}
},
created() {
this.$store.commit('runServer')
}
}
</script>
Property or method "showPopup" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question