Skip to content

Commit

Permalink
fix(alipay): 修复支付宝小程序混写原生页面编译出错,close #9471
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Jun 9, 2021
1 parent c064f62 commit dcdd4ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/taro-alipay/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function modifyPageTemplate (ctx: IPluginContext) {
// 筛选出使用了自定义组件的页面
miniPlugin.pages.forEach(page => {
const config = miniPlugin.filesConfig[miniPlugin.getConfigFilePath(page.name)].content
if (config?.hasOwnProperty('usingComponents') && Object.keys(config.usingComponents).length) {
if (!page.isNative && config?.hasOwnProperty('usingComponents') && Object.keys(config.usingComponents).length) {
pages.push(page.name)
}
})
Expand All @@ -43,7 +43,8 @@ function modifyPageTemplate (ctx: IPluginContext) {

pages.forEach(page => {
const templateName = `${page}.axml`
const src = assets[templateName].source()
const assetsItem = assets[templateName]
const src = assetsItem._value ? assetsItem._value.toString() : assetsItem.source()
let relativePath
const templateCaller = src.replace(/<import src="(.*)base\.axml"\/>/, function (_, $1) {
relativePath = $1
Expand Down

0 comments on commit dcdd4ae

Please sign in to comment.