数组对象,JSON.parse()解析
let arr = [ {name : '王渊' , age : '20' , py :'[{boy : 'zhansan ' },{ girl : 'xiaoli' }]' } ]
***注意 py 也是数组对象结构
`arr.forEach(item=>{
item.py = JSON.parse(item.py)
})`
图片示例为接口返回的样子
/此代码仅为上述示例代码
`<view class="card-item" v-for="(item,index) in historyArr" :key='index'>`
`{{item.applicant_detail[0].paykind}}`
`</view>`
直接JSON.parse(item.applicant_detail),在页面上渲染的话,v-for historArr以后 直接{{item.applicant_detail[0].paykind}}
数组或对象转为json字符串 :::JSON.stringify()
json字符串解析成为数组或对象 ::: JSON.parse()