W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
文件默認(rèn)輸出就是(支付寶)小程序的版本,因此條件編譯主要是針對域外的小程序(如:微信小程序)
如:自定義組件(頁面也是如此)需要做兩端的區(qū)分 頁面引用該組件的代碼:
{
"usingComponents": {
"demo": "../../components/demo/index"
}
}
默認(rèn)情況下,組件都包含了axml
/acss
/js
/json
四個文件
- components
- demo
- index.axml
- index.acss
- index.js
- index.json
由于在微信小程序下。邏輯差異較大??梢灾苯佑?code>.wx來做區(qū)分
- components
- demo
- index.axml(支付寶版本)
- index.acss(支付寶版本)
- index.js(支付寶版本)
- index.json
- index.wx.axml(微信版本)
- index.wx.acss(微信版本)
- index.wx.js(微信版本)
在 MorJS 編譯輸出的時候,在輸出目錄下_wechat
,會優(yōu)先用.wx
的版本來生成對應(yīng)的微信版本源文件
- _wechat
- components
- demo
- index.wxml
- index.wxss
- index.js
- index.json
而在Page
的json
中的usingComponents
是不需要做任何修改的,依然保留原本的引用路徑即可。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: