普通网友 2017-09-05 01:38 采纳率: 52.6%
浏览 1002

关于数组里面传对象的问题


items: [{
                    title: "north panel",
                    html: "上",
                    region: "north",
                    height: 50
                }, {
                    title: "south panel",
                    html: "下",
                    region: "south",
                    height: 50
                }, {
                    title: "west panel",
                    html: "左",
                    region: "west",
                    width:100
                }, {
                    title: "east panel",
                    html: "右",
                    region: "east",
                    width: 100
                }, {
                    title: "center panel",
                    html: "中",
                    region: "center"
                }]

想写成这个样子,应该怎么写js文件呢?

  • 写回答

6条回答

  • chenjiexixi 2017-09-05 01:44
    关注

    你是想要json对象么?不如在java代码写个实体类,用list装这个实体类,然后通过Gson自动转换为Json对象传到页面

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料