【问题标题】:get response in html tag in vuejs在 vuejs 的 html 标记中获取响应
【发布时间】:2020-07-09 05:14:34
【问题描述】:

请帮助我,我怎样才能像在 console.loge 中一样在 Html 标记中获取数据, 我想在<span class="fa fa-heart-o"></span> 中得到这个console.log(this.likeDes[0].like_dislike)

【问题讨论】:

    标签: laravel vue.js vuejs2 laravel-vue


    【解决方案1】:

    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>

    【讨论】:

      猜你喜欢
      • 2014-10-18
      • 2021-02-04
      • 2020-09-04
      • 2011-05-12
      • 1970-01-01
      • 2020-03-22
      • 2012-11-02
      • 2012-11-07
      • 2015-08-20
      相关资源
      最近更新 更多