@dolphinweex/weex-harmony 0.1.68 → 0.1.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/transform-loader.js
CHANGED
|
@@ -24,6 +24,8 @@ const componentSet = new Set()
|
|
|
24
24
|
const vBindMap = new Map()
|
|
25
25
|
// v-for 场景下,将 v-bind 转为方法调用所需的方法映射
|
|
26
26
|
const vBindMethodMap = new Map()
|
|
27
|
+
let vBindComputedCounter = 0
|
|
28
|
+
let vBindMethodCounter = 0
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
31
|
* 判断是否为windows环境
|
|
@@ -86,7 +88,7 @@ function traverseNode(node, parent = null) {
|
|
|
86
88
|
if (attr.key === 'v-bind') {
|
|
87
89
|
if (isInsideVFor) {
|
|
88
90
|
// v-for 场景:将 v-bind="expr" 转为 v-bind="customVBindMethodX(expr)"
|
|
89
|
-
const methodName = `customVBindMethod${
|
|
91
|
+
const methodName = `customVBindMethod${vBindMethodCounter++}`;
|
|
90
92
|
const argExpression = (attr.value || '').trim() || 'arg';
|
|
91
93
|
const paramName = 'arg';
|
|
92
94
|
if (!vBindMethodMap.has(methodName)) {
|
|
@@ -120,7 +122,7 @@ function traverseNode(node, parent = null) {
|
|
|
120
122
|
value: generator(parsedAst).code,
|
|
121
123
|
};
|
|
122
124
|
} else {
|
|
123
|
-
const customComputedName = `customVBindComputed${
|
|
125
|
+
const customComputedName = `customVBindComputed${vBindComputedCounter++}`; // 自定义的名字
|
|
124
126
|
vBindMap.set(customComputedName, {
|
|
125
127
|
computedName: attr.value,
|
|
126
128
|
customComputedName,
|