《实战纪录片 1 》原生开发小程序中遇到的问题和解决方案

1、问题一:原生开发中 request请求中返回 的数据无法 使用this传递给 data{}中怎么办?

1、将success函数 改成箭头函数
修改前的函数
在这里插入图片描述
修改后的函数
在这里插入图片描述
在这里插入图片描述

2、刚登录后如何将token信息保存,然后在后边的信息中使用。

在这里插入图片描述
在这里插入图片描述

3、小程序下边的导航栏如何设置

1、首先新建好对应的页面
2、其次在app.json 文件中 增加编辑 tabBat 属性

 "tabBar": {
    "list": [
      {
        "pagePath": "pages/index/index",
        "text": "首页",
        "iconPath": "./static/images/12.png",
        "selectedIconPath": "./static/images/11.png"
      },
      {
        "pagePath": "pages/knowledgePage/knowledgePage",
        "text": "知识库",
        "iconPath": "./static/images/22.png",
        "selectedIconPath": "./static/images/21.png"
      },
      {
        "pagePath": "pages/gamePage/gamePage",
        "text": "荣耀榜",
        "iconPath": "./static/images/22.png",
        "selectedIconPath": "./static/images/21.png"
      },
      {
        "pagePath": "pages/myPage/myPage",
        "text": "我的",
        "iconPath": "./static/images/22.png",
        "selectedIconPath": "./static/images/21.png"
      }
    ]
  }

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部