[Vuejs]-Property or method is not defined on the instance in v-bind:class but is in data

0👍

Ther problem was that I didn’t put tag < /script> on end file

0👍

you can check it out by like this :

<template>
 <div class="snack-visible" :class="success ? 'snack-success' : 'snack-danger'">
  <div>
     <strong>{{message}}</strong>
  </div>
</div>
</template>

<script>

export default {
  data(){
    return{

        showing: false,
        message:"",
        success:false
    }
 }
//here other methods and created();
}
</script>

Leave a comment