Skip to content

Commit

Permalink
fix(transformer): 替换掉 key 中包含 LOOP_ORIGINAL 的字符串
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Dec 25, 2019
1 parent c2044dd commit 1c99523
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/taro-transformer-wx/src/create-html-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ function stringifyAttributes (input: object, componentName: string) {
}
}

if (Adapters.weapp === Adapter.type && key === Adapter.key && typeof value === 'string') {
if (value.startsWith(LOOP_ORIGINAL)) {
value = value.replace(LOOP_ORIGINAL + '.', '')
}
if (
(Adapters.weapp === Adapter.type || Adapters.qq === Adapter.type) &&
key === Adapter.key &&
typeof value === 'string'
) {
value = value.split(`${LOOP_ORIGINAL}.`).join('')
}

if (value !== true) {
Expand Down

0 comments on commit 1c99523

Please sign in to comment.