微信小程序简介

注册ID

https://mp.weixin.qq.com/cgi-bin/wx

 

下载开发工具以及小程序的API

https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html

 

 

app.json 用来对微信小程序的进行全局配置,决定页面文件的路径、窗口表现、设置网络超时时间、设置多tab 等。

具体内容可以查看api https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/app.html

{

{

  "pages":[

    "pages/index/index",

    "pages/logs/logs"

  ],

  "window":{

    "backgroundTextStyle":"light",

    "navigationBarBackgroundColor": "#fff",

    "navigationBarTitleText": "WeChat",

    "navigationBarTextStyle":"black"

  }

"tabBar": {

    "color": "#000000",

    "selectedColor": "red",

    "list":[

     {

       "pagePath":"pages/index/index",

       "text":"首页"

     },{

       "pagePath": "pages/logs/logs",

       "text": "日志"

     }

   ]

  }

}

}

Page /index 首页  一个文件夹包含三个文件  .js .wxml  .wxss    一个文件夹代表一个页面

Window 设置导航栏格式

 

TabBar

底部

页面编写,文件名需要与文件夹一致,  .js文件需要有page({

data: {

   logs: []

  },

 onLoad: function () {

    this.setData({

     logs: (wx.getStorageSync('logs') || []).map(log => {

       return util.formatTime(new Date(log))

     })

   })

  }

 

})

 

App.js

myData:{

     username:"wuduanqu"

  },

Index.js

this.setData({motto:app.myData.username});

将在app取到的全局值赋值给motto

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值