Snackabry do logowania i wylogowania
This commit is contained in:
parent
8b19247175
commit
d023900d73
@ -7,6 +7,20 @@
|
|||||||
</v-btn>
|
</v-btn>
|
||||||
</v-snackbar>
|
</v-snackbar>
|
||||||
|
|
||||||
|
<v-snackbar v-model="snackbarLogout" :timeout="4000" top color="primary success-text">
|
||||||
|
<span>Wylogowano</span>
|
||||||
|
<v-btn flat color="white" @click="snackbarLogout = false">
|
||||||
|
<v-icon>clear</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</v-snackbar>
|
||||||
|
|
||||||
|
<v-snackbar v-model="snackbarLogin" :timeout="4000" top color="primary success-text">
|
||||||
|
<span>Poprawnie zalogowano</span>
|
||||||
|
<v-btn flat color="white" @click="snackbarLogin = false">
|
||||||
|
<v-icon>clear</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</v-snackbar>
|
||||||
|
|
||||||
<v-toolbar flat app>
|
<v-toolbar flat app>
|
||||||
<v-toolbar-side-icon class="grey--text" @click="drawer = !drawer">
|
<v-toolbar-side-icon class="grey--text" @click="drawer = !drawer">
|
||||||
<!-- burger menu icon, color zmieniony jak na ten tekstu -->
|
<!-- burger menu icon, color zmieniony jak na ten tekstu -->
|
||||||
@ -33,8 +47,9 @@
|
|||||||
</v-list>
|
</v-list>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
|
|
||||||
<v-btn flat color="grey" @click="userLogout">
|
<v-btn flat color="grey" @click="userAction">
|
||||||
<span>Sign Out</span>
|
<span v-if="isLogged">Wyjdź</span>
|
||||||
|
<span v-if="!isLogged">Zaloguj</span>
|
||||||
<v-icon right>exit_to_app</v-icon>
|
<v-icon right>exit_to_app</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
@ -77,7 +92,10 @@ export default {
|
|||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
drawer: false, //niepokazywac na poczatku
|
drawer: false, //niepokazywac na poczatku
|
||||||
snackbar: false
|
snackbar: false,
|
||||||
|
snackbarLogout: false,
|
||||||
|
isLogged: true,
|
||||||
|
snackbarLogint: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
@ -86,10 +104,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
userLogout(){
|
userAction(){
|
||||||
//wylogowanie
|
if(this.isLogged){
|
||||||
|
this.snackbarLogout = true
|
||||||
|
this.isLogged = false
|
||||||
console.log("wylogowano")
|
console.log("wylogowano")
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
this.snackbarLogout = false
|
||||||
|
this.snackbarLogin = true
|
||||||
|
this.isLogged = true
|
||||||
|
console.log("zalogowano")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user