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