Vue-切割json数组字符串并循环输出

Json

        "detailList":[  
                  " 04/08/2016 - LA - -  Dept. - TITLE (Lien Reported)",
                  " 04/05/2016 - KA - - Motor Dept. - REGISTRATION RENEWAL (Lease) ",
                  " 03/20/2016 - SA - 30 - Motor Dept. - ODOMETER",
                  " 03/16/2016 - - - Source - DEALER "
               ]

*.vue

<template>
<div class="tab-pane" id="historyReport">
                        <p class="ptb16 plr30 bgc-0d7dce fs16 c-fff">History Report</p>
                        <div class="panel-group vehicleHistory">
                            <div class="ptb16 plr20" v-for="e in strs">
                                <div class="mb12 df jc-sb">
                                    <span class="fs16">{{e.split('-')[3]}}</span><span class="fs12 lh24 c-c4c4c4">{{e.split('-')[0]}}</span>
                                </div>
                                <p class="fs12">Location:<span>{{e.split('-')[1]}}</span></p>
                                <p class="fs12">Mileage Record:<span>{{e.split('-')[2]}}</span>Miles</p>
                                <p class="fs12"><span>{{e.split('-')[4]}}</span></p>
                                
                            </div>
                                
                        </div>
                    </div>
</template>

<script>
export default {
  data () {
      strs: []
    }
  },
  created: function () {
    this.getCarReport()
  },
  methods: {
    getCarReport () {
      return this.$http.get('/***/****/' + this.id + '.json')
      .then((response) => {
        this.shareCarInfo = response.data.data
        this.strs = this.shareCarInfo.****.****.detailList
       })
    }
  }
}
</script>

 

转载于:https://www.cnblogs.com/Harold-Hua/p/8213342.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值