收藏
回答

写着写着就报错了,是我的js格式写错了吗?

const app = getApp()


Page({
  onShareAppMessage() {
    return {
      title'swiper',
      path'page/component/pages/swiper/swiper'
    }
  },


  data: {
    background: [
      'https://fuss10.elemecdn.com/d/c0/56cfcdabba9fec97a3307b571ca8cjpeg.jpeg',
      'https://fuss10.elemecdn.com/6/f2/5cd85b966281a8d545c34019d0fd1jpeg.jpeg',
      'https://fuss10.elemecdn.com/e/55/b00aef689cb424aaaeae9d50d3e76jpeg.jpeg',
      'https://fuss10.elemecdn.com/a/88/98d10d5580ce28db07673e28726ccjpeg.jpeg'
    ],
    indicatorDotsfalse,
    verticalfalse,
    autoplaytrue,
    interval2000,
    duration500,


    //picker
    foodTypes:['全部菜品','披萨','面条','水果','寿司','三明治'],
    foodTypesIndex:0,
    rankTypes:['综合排序','热度','价格','好评','时间'],
    rankTypesIndex:0,
    foodList=[]
  },
  onLoadfunction (options{
    let originData = app.globalData.foodList;
    let foodList = [];
    for (let i = 0; i < originData.length; i++) {
      foodList.push(originData[i]);
    }
    this.setData({foodList:foodList});
  }
})



回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2020-04-11

    2020-04-11
    有用 1
    回复 1
    • Alone
      Alone
      2020-04-11
      谢谢大神
      2020-04-11
      回复
登录 后发表内容
问题标签