來自github
開始之前
注冊開發(fā)者:https://mp.weixin.qq.com
下載開發(fā)工具:https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html
下載官方體驗小程序源碼:https://mp.weixin.qq.com/debug/wxadoc/dev/
用開發(fā)工具添加體驗小程序,體驗
官方簡易教程:https://mp.weixin.qq.com/debug/wxadoc/dev/
組件庫:https://mp.weixin.qq.com/debug/wxadoc/dev/component/
常見問題及解決方案
本地緩存storage,類似localStorage,可以存取改刪 String/Object
-
<navigator url="../detail/detail?name={{item.name}}"></navigator>
跨頁面通信,發(fā)現(xiàn)一個方案是:https://github.com/danneyyang/weapp-event
-
<template name="header"> <view class="page-header"> <text class="page-header-text">{{title}}</text> <view class="page-header-line"></view> </view> </template>
如何使用?
-
<template is="header" data="{{title: 'start/stopRecord、play/pause/stopVoice'}}"/>
方法:開發(fā)者工具-點擊項目-勾選開發(fā)環(huán)境不校驗請求域名及TLS版本;
-
Page 內(nèi)部方法如何調(diào)用?方法:this.fn(),例如:
-
fn:function () {
-
console.log("fn");
-
},
-
onReady: function () {
-
var that = this;
-
//that = this;
-
that.fn();
-
}
-
底部tabBar菜單欄顯示不出來 解決方法:pages先后順序配置正確,依次是第一個tabBar的路徑,第二個tabBar的路徑。。app頁面的路徑,例如:
-
{
-
"pages":[
-
"pages/week/index",
-
"pages/mine/index",
-
"pages/index/index"
-
],
-
"window":{
-
"backgroundTextStyle":"light",
-
"navigationBarBackgroundColor": "#FC3D39",
-
"navigationBarTitleText": "title",
-
"navigationBarTextStyle":"white"
-
},
-
"tabBar": {
-
"color": "#9a9a9a",
-
"selectedColor": "#FC3D39",
-
"borderStyle": "black",
-
"backgroundColor": "#ffffff",
-
"list": [{
-
"pagePath": "pages/week/index",
-
"iconPath": "image/calendar.png",
-
"selectedIconPath": "image/calendar2.png",
-
"text": "first"
-
}, {
-
"pagePath": "pages/mine/index",
-
"iconPath": "image/mine.png",
-
"selectedIconPath": "image/mine2.png",
-
"text": "second"
-
}]
-
}
-
}
|