i'm trying to create a function that shows the site content only when after reading the prompt, the user clicks on ok or confirm. This is what i got so far. I'm using VueCLI for this! This are the errors i got: 10:1 error 'add' is not defined no-undef 14:9 error Move function declaration to function body root no-inner-declarations 14:18 error 'remove' is defined but never used no-unused-vars
Main.js:
import Vue from 'vue'
import App from './App.vue'
Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')
function validation() {
var site = prompt("some text");
if (site == true) {
function remove() {
var element = document.getElementById("app");
element.classList.remove("none");
}
} else if (site == false) {
var response = document.getElementById("response");
response.innerHTML = "some text";
}
}
App.vue:
<template>
<div class="none" id="app">
<h1 id="response"></h1>
<HeaderComp/>
<MainComp/>
<FooterComp/>
</div>
</template>
scss:
<style lang="scss">
@import "bootstrap/dist/css/bootstrap.min.css";
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.none{
display: none;
}
</style>