如何在Vue.js中获取格式字符串

时间:2018-06-28 09:07:18

标签: arrays json vue.js

嗨,我有这个脚本

<div class="description text-left" v-for="item in siteObject.line_info">
<small>{{siteObject.line_info}}</small>
</div>

此视图: [{“ lineid”:“ BN00003054538”,“ site_site_id”:“ 1961011481”,“ site_id”:“ 273242829”}] 我该如何更改它以具有如下视图:

编号:BN00003054538
site_site_id:1961011481
site_id:273242829

谢谢

1 个答案:

答案 0 :(得分:0)

您正在使用var fs = require('fs'); //**run** npm install fs **if not installed yet in cmd** var arrayOfObjects = [{"id":28,"Title":"Sweden"}, {"id":56,"Title":"USA"},{"id":89,"Title":"England"}]; fs.writeFile("./test.csv", convertToCSV(arrayOfObjects)); 。因此,v-for="item in siteObject.line_info"中的当前项目。使用该ìtem访问其属性

siteObject.line_info