how can i display an element if a user is logged in in vuejs


This Content is from Stack Overflow. Question asked by jibzy

i’m trying to display this div tag when a token is stored in my browser


i get token in my browser


this is my script tag

export default {
  name: "app",
  components: {},
  data() {
    return {
  mounted() {
    const token = localStorage.getItem("token")

please how can i go about this


Check the Answers

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?