Upon pressing the button labeled Close
, an error message appeared in the console as shown below:
"Error: Cannot find module './undefined'"
found in
---> <WhatsNew> at src/components/WhatsNew.vue
Displayed below is the content of WhatsNew.vue
:
<template>
<u-modal v-model="modalActive">
......
......
<div class="whats-new-options">
<div id="whats-new-checkbox">
<u-checkbox v-model="whatsNewStatusInactive" label="Don't show again"/>
</div>
<div id="whats-new-next-button">
<u-button id="whats-new-close-btns" full color="secondary" @click="nextNew">{{notViewedAll ? 'Next' : 'Close' }}</u-button>
</div>
</div>
</div>
</u-modal>
</template>
<script>
import { mapGetters, mapMutations } from "vuex";
export default {
data() {
return {
modalActive: false,
notViewedAll: true,
newFeaturesOnUsedCount: 3,
current: 0,
}
},
methods: {
...mapMutations("client", ["updateWhatsNewStatus"]),
nextNew() {
if (this.current <= this.newFeaturesOnUsedCount -1 ){
this.current += 1
}
if (this.current >= this.newFeaturesOnUsedCount && !this.notViewedAll) {
this.modalActive = false
}
if (this.current >= this.newFeaturesOnUsedCount - 1) {
this.notViewedAll = false
}
}
}
An attempt to resolve the error was made by adjusting:
<u-modal v-model="modalActive">
to
<u-modal v-model="modalActive" v-if="modalActive">
Although using v-if
to manage the modal felt like a workaround. The original use of v-modal
should have sufficed. What could be causing the aforementioned error? Your insights are appreciated.