laravelvue.jsvuejs2laravel-vue

get response in html tag in vuejs


please help me that how can I get data in Html tag like I get in console.loge, I want to get this console.log(this.likeDes[0].like_dislike) in <span class="fa fa-heart-o"></span>


Solution

  • var app = new Vue({
      el: "#app",
      data: {
        likes: 5
      }
    })
    
    // You may replace 5 with the likes count.
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
    
    <link href = "https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel = "stylesheet">
    
    <div id = "app">
      <i class="fa fa-heart-o"> {{likes}}</i>
    </div>