Skip to content

Commit

Permalink
get data from locatStorage is ongoing
Browse files Browse the repository at this point in the history
  • Loading branch information
Joyontokarmakar committed Jul 28, 2022
1 parent 2436755 commit 495033f
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions components/headers/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<NuxtLink to="/services" class="px-3 py-2"> Services </NuxtLink> -->
<!-- <NuxtLink to="/sign-up" class="px-3 py-2"> Signup </NuxtLink> -->
<!-- {{userData}} -->


<!-- <NuxtLink v-if="userData.isLogin == false" to="/login" class="px-3 py-2">Login</NuxtLink>
<Button v-else class="px-3 py-2" @click="logout"> Logout </Button>
<div v-if="userData.isLogin == true" class="rounded-full w-10 h-10 shadow-md bg-corporate text-corporateLight flex justify-center items-center">
Expand Down Expand Up @@ -45,22 +47,21 @@

<script setup>
const sidebar = ref(false);
// const userData = JSON.parse(localStorage.getItem('userData'))
const userInfo = reactive({
fName: "",
lName: "",
email: "",
isLogin: true
});
// const userInfo = reactive({
// fName: "",
// lName: "",
// email: "",
// isLogin: true
// });
onMounted(()=> {
storage();
})
const storage = () =>{
console.log(localStorage.getItem("userData"));
}
const logout = () => {
localStorage.removeItem('userData');
// console.log(localStorage.getItem("userData"));
}
// const logout = () => {
// localStorage.removeItem('userData');
// }
const open = () =>{
sidebar.value = !sidebar.value
};
Expand Down

0 comments on commit 495033f

Please sign in to comment.