<script>
export default {
  name: "AuthUserComponent",
  data:function(){
    return {
      isLoggedIn: true,
      counter : 0
    }
  },
  methods: {
    login: function() {
      this.isLoggedIn = true;
      this.counter ++;
    },
    logout: function() {
      this.isLoggedIn = false;
      this.counter ++;
    }
  }
}
</script>

<template>
  <pre>{{isLoggedIn}} counter: {{this.counter}}</pre>/
  <H2 class="p">User</H2>
  <div class="container" style="color:white">
    <div class="row">
      <div class="col-md-6">
        <div class="card">
          <div class="card-header text-white">
            <div class="card-body">
              <ul class="list-group" v-if="!isLoggedIn&&counter>0">

                <li class="list-group-item">
                  <p class="h3 fw-bold text-danger" >Thank you</p>
                  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores assumenda commodi corporis eaque facilis hic illo ipsum itaque nemo nobis placeat quasi qui quisquam repellendus, reprehenderit sequi tempore ullam vitae!

                </li>
                  </ul>
              <ul class="list-group" v-if="isLoggedIn&&counter">
                <li class="list-group-item">
                  <p class="h3 fw-bold text-success" >Welcome User</p>
                  Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt ipsum molestiae natus recusandae voluptatum. Animi atque autem blanditiis, cupiditate et id nam nemo officiis omnis, quas quia sit? A, recusandae!
                </li>
              </ul>

            </div>
        </div>
      </div>
    </div>
  </div>
    <button class="btn btn-success" @click="login" v-if="!isLoggedIn">Login</button>
    <button class="btn btn-danger" @click="logout" v-if="isLoggedIn">Logout</button>
  </div>
</template>

<style scoped lang="css">

</style>
