上章我們看到一個小程序的page是由 .wxml .wxss .js .json組成。
- wxml:相當於html,開發小程序的頁面
- wxss:相當於css,小程序頁面渲染樣式
- js:實現小程序的動態方法等,包括該page的生命周期函數等
- json:用於小程序的配置
如果你已經很熟練掌握Html,那么通過下表對照就可以快速掌握小程序的基礎語法了。
| html | 小程序 |
| <div></div> | <view></view> |
| <h1><h2>....<h6> <p><span> |
<text></text> |
| <input type="text"> <input type="checkbox"> <input type="radio"> <input type="file"> |
<input /> <checkbox /> <radio /> <view bindtap="changeImage"></view> |
| <select> <option></option> <option></option> </select> |
<picker range="{{area}}"> <view> {{area[index]}}</view> </picker>
|
| <a href="#"></a> | <navigator url="#" redirect></navigator> |
| <img src=""> | <image mode="aspectFill" src=""> |
| <i class="icon"></i> | <icon></icon> |
小程序的更多幫助可以參考 小程序官方文檔
有興趣的朋友可以加我的qq群交流學習,群里有更多源碼,學習資料
QQ群:741909960
