vue 循环输出数据出错 -问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文
阿里云
为了无法计算的价值
打开APP
阿里云APP内打开

vue 循环输出数据出错

2016-06-23 11:20:22 2951 2
<ul id="example-1">
  <li v-for="item in items">
        {{ item.shop_name }}
    </li>

</ul>

  var vm = new Vue({
        el:"#example-1",
        data: {
           items:[]
        },
        ready: function() {
            var self = this;
            $(document).ready(function(){
                $.post("http://xxx.com/index.php/Home/Test/test",
                    {
                        robot:"123",
                        usertype:"0",
                        userid:"22",
                        shopid:"4",
                        transToCondition:4
                    },
                    function (data, Status) {
                        self.items = JSON.stringify(data);
                    }, "jsonp");
            });
        }
    })

ajax获取到的数据

全选复制放进笔记
[{"shop_id":"3","shop_name":"\u65b0\u4e16\u754c\u4e2d\u9910","shop_bossid":"22","shop_history_bossid":"-22","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1460110593","shop_updatetime":"1460110593"},{"shop_id":"4","shop_name":"\u4e2d\u4e1c\u4e16\u754c","shop_bossid":"22","shop_history_bossid":"-18-15","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1460111243","shop_updatetime":"1460111243"},{"shop_id":"5","shop_name":"\u80af\u6253\u9e21","shop_bossid":"22","shop_history_bossid":"","shop_condition":"1","shop_isdelete":"0","shop_createtime":"1460116195","shop_updatetime":"1460116195"},{"shop_id":"6","shop_name":"\u54c8\u6839\u8fbe\u65af","shop_bossid":"22","shop_history_bossid":"-22-17","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1460116659","shop_updatetime":"1460116659"},{"shop_id":"7","shop_name":"\u97e9\u56fd\u77f3\u9505\u62cc\u996d","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"1","shop_createtime":"1460119520","shop_updatetime":"1460119520"},{"shop_id":"8","shop_name":"\u5438\u5438\u5427","shop_bossid":"22","shop_history_bossid":"","shop_condition":"1","shop_isdelete":"1","shop_createtime":"1460119564","shop_updatetime":"1460119564"},{"shop_id":"9","shop_name":"Ha","shop_bossid":"22","shop_history_bossid":"","shop_condition":"1","shop_isdelete":"1","shop_createtime":"1460172905","shop_updatetime":"1460172905"},{"shop_id":"10","shop_name":"\u5566\u5566\u5566","shop_bossid":"22","shop_history_bossid":"","shop_condition":"1","shop_isdelete":"1","shop_createtime":"1460375490","shop_updatetime":"1460375490"},{"shop_id":"11","shop_name":"\u70e4\u9c7c\u5427","shop_bossid":"22","shop_history_bossid":"-22","shop_condition":"0","shop_isdelete":"1","shop_createtime":"1460375532","shop_updatetime":"1460375532"},{"shop_id":"12","shop_name":"\u5b9c\u5bbe\u71c3\u9762","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1460378016","shop_updatetime":"1460378016"},{"shop_id":"13","shop_name":"\u78e8\u83dc\u5200","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1460421729","shop_updatetime":"1460421729"},{"shop_id":"26","shop_name":"\u7f8a\u7ecd\u6b66","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1462841544","shop_updatetime":"1462841544"},{"shop_id":"27","shop_name":"\u4e1c\u62c9\u897f\u626f","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1462842809","shop_updatetime":"1462842809"},{"shop_id":"29","shop_name":"13123","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1462955116","shop_updatetime":"1462955116"},{"shop_id":"30","shop_name":"\u9999\u5929\u4e0b\u706b\u9505","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1463276283","shop_updatetime":"1463276283"},{"shop_id":"31","shop_name":"\u9999\u5929\u4e0b\u706b\u9505","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1463276286","shop_updatetime":"1463276286"},{"shop_id":"32","shop_name":"\u9999\u5929\u4e0b\u706b\u9505","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1463276289","shop_updatetime":"1463276289"},{"shop_id":"33","shop_name":"\u8d85\u5e02\u5b9d","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1463546341","shop_updatetime":"1463546341"},{"shop_id":"34","shop_name":"\u8d85\u5e02\u5b9d","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1463546342","shop_updatetime":"1463546342"},{"shop_id":"35","shop_name":"\u8d85\u5e02\u5b9d","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"1","shop_createtime":"1463546343","shop_updatetime":"1463546343"},{"shop_id":"36","shop_name":"\u8d85\u5e02\u5b9d","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"1","shop_createtime":"1463546344","shop_updatetime":"1463546344"},{"shop_id":"37","shop_name":"\u8d85\u5e02\u5b9d","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1463546345","shop_updatetime":"1463546345"},{"shop_id":"38","shop_name":"","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"1","shop_createtime":"1463546345","shop_updatetime":"1463546345"},{"shop_id":"39","shop_name":"","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1463546346","shop_updatetime":"1463546346"},{"shop_id":"40","shop_name":"","shop_bossid":"22","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1463546347","shop_updatetime":"1463546347"},{"shop_id":"41","shop_name":"199\u9910\u5427","shop_bossid":"32","shop_history_bossid":"","shop_condition":"0","shop_isdelete":"0","shop_createtime":"1463550835","shop_updatetime":"1463550835"}]

screenshot
screenshot

取消 提交回答
全部回答(2)
  • 杨冬芳
    2019-07-17 19:46:03

    JSON.stringify 用错了

    0 0
  • 西秦说云
    2019-07-17 19:46:02

    JSON.stringify 用错了

    0 0
添加回答
相关问答

1

回答

怎么捕获组件vue的错误信息?

2020-05-23 15:51:37 1413浏览量 回答数 1

1

回答

说下你的vue项目的目录结构,如果是大型项目你该怎么划分结构和划分组件呢?

2020-05-23 15:53:42 1582浏览量 回答数 1

1

回答

vue父子组件双向绑定的方法有哪些?

2020-05-23 15:55:14 948浏览量 回答数 1

1

回答

在 Vue 中,子组件为何不可以修改父组件传递的 Prop #前端面试

2020-05-23 13:52:16 820浏览量 回答数 1

1

回答

使用 React / Vue构建项目时为什么要在列表组件中写 key,其作用是什么?#前端面试

2020-05-23 13:21:05 1130浏览量 回答数 1

1

回答

说说你对vue组件的设计原则的理解

2020-05-23 12:16:43 677浏览量 回答数 1

0

回答

vue中一个页面里调用一个组件并传参,那个组件怎么处理参数?也是onload吗?

2019-08-09 12:53:42 521浏览量 回答数 0

4

回答

OSS使用vue的ElementUI组件上传返回的文件路径多个反斜杠?

2017-06-25 01:05:36 8842浏览量 回答数 4

1

回答

.vue 单文件组件,fetch异步怎么更新视图数据?

2016-06-22 15:22:29 2137浏览量 回答数 1

1

回答

webpack如何提取vue组件的css到独立文件中

2016-06-13 14:51:13 6561浏览量 回答数 1
+关注
杨冬芳
IT从业
1
文章
9167
问答
问答排行榜
最热
最新
相关电子书
更多
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载
冬季实战营第三期:MySQL数据库进阶实战
立即下载