[TOC]
# 介紹
為了使用 `Taro` 兼容全平臺,
請遵循以下規范:
# 數據傳遞
組件不能直接使用 `connect` 進行狀態數據連接,應當通過父組件傳遞 `props`,傳遞數據。
# UI設計模版要按750寬出圖
# 組件
## `app.wxss`
微信小程序 `app.wxss` 的樣式在自定義組件不生效 在自定義組件的 js 文件中添加,支付寶默認所有頁面生效:
```
// 開啟全局樣式使用
options: {
addGlobalClass: true
}
```
## 默認數據
不支持將 `data` 中任何一項的 value 設為`undefined`,在 `setState` 的時候也請避免這么用。你可以使用 `null` 來替代。
## 生命周期
百度小程序與微信小程序 渲染組件時,觸發的生命周期完全不同
# 事件系統的不一致
支付寶事件:
[https://docs.alipay.com/mini/framework/event-object](https://docs.alipay.com/mini/framework/event-object)
小程序:
[https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/event.html](https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/event.html)
# css
## `background-image` 支持網絡的圖片鏈接或者 base64,`config /index.js` 中配置轉base64
## `width` 最好加上`100%`;
# 全局變量 `global`
微信|百度都有,支付寶沒有暴露全局變量 `global`
# 其他問題
1. 對于像 `button` 這樣的類似組件,完全可以用 `View` 實現。
2. 登錄和支付那一塊,需要根據文檔來自己調整。工具也沒辦法轉換,因為他們的實現都不一樣的。
# 各種小程序的官網與調試工具地址
[微信小程序文檔](https://developers.weixin.qq.com/miniprogram/dev/index.html)
[百度小程序文檔](https://smartprogram.baidu.com/docs/develop/tutorial/codedir/)
[支付小程序文檔](https://docs.alipay.com/mini/developer/getting-started)
[頭條小程序文檔](https://microapp.bytedance.com/docs/framework/)
[QQ小程序文檔](https://q.qq.com/wiki/develop/miniprogram/frame/catalog.html)
[淘寶小程序](https://developers.taobao.com/light-shop/) 開始內測,叫輕店鋪
[快應用文檔](https://www.quickapp.cn/docCenter/post/95)
[快應用調試工具](https://www.quickapp.cn/docCenter/post/95)
[快應用 demo1](https://github.com/quickappcn/sample)
[快應用 demo2](https://github.com/RubyLouvre/quickdemo)
[快應用的一個UI庫](https://github.com/JDsecretFE/quist-ui)
[微信小程序升級日志](https://developers.weixin.qq.com/miniprogram/dev/devtools/uplog.html)
[快應用升級日志](https://doc.quickapp.cn/changelog/1020.html)
[百度小程序升級日志](https://smartprogram.baidu.com/docs/develop/tutorial/swanchangelog/)
[支付寶小程序升級日志](https://docs.alipay.com/mini/developer/changelog)
[QQ輕應用文檔](https://h5.qianbao.qq.com/wiki/articleH5?id=1237)
# 參考
[常見問題](https://ecomfe.github.io/okam/#/questions/index)
[多端統一開發實踐.pdf](http://cdn.jsnewbee.com/files/%E5%A4%9A%E7%AB%AF%E7%BB%9F%E4%B8%80%E5%BC%80%E5%8F%91%E5%AE%9E%E8%B7%B5.pdf)
https://rubylouvre.github.io/nanachi/documents/diff.html