@dongmingzhixiu/vuexir-compiler 0.5.1 → 0.5.2

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.
@@ -2172,12 +2172,26 @@ function walkElement(node, classProps, comboRules, scopedRules, pseudoRules, war
2172
2172
  continue;
2173
2173
  }
2174
2174
  if (child.type === NodeTypes.ELEMENT) {
2175
- // R137:<button><span>{{ x }}</span></button> → 动态文案走 bind(此前只能收静态文本)
2176
- const interp = (child.children ?? []).find((cc) => cc.type === NodeTypes.INTERPOLATION);
2177
- if (interp && !props.bind && !props.label) {
2178
- const raw = textOf(interp.content).trim();
2179
- if (raw && !/['"]/.test(raw)) {
2180
- props.bind = addJsExprState(raw);
2175
+ // R137/R138:<button><span>{{ a }}</span><span>{{ b }}</span></button>
2176
+ // → 把所有动态段拼成一句文案(此前只收静态文本,或只取第一段)
2177
+ if (!props.bind && !props.label) {
2178
+ const names = [];
2179
+ const collect = (el) => {
2180
+ for (const cc of el.children ?? []) {
2181
+ const node2 = cc;
2182
+ if (node2.type === NodeTypes.INTERPOLATION) {
2183
+ const raw = textOf(node2.content).trim();
2184
+ if (raw && !/['"]/.test(raw))
2185
+ names.push(raw);
2186
+ }
2187
+ else if (node2.children) {
2188
+ collect(node2);
2189
+ }
2190
+ }
2191
+ };
2192
+ collect(child);
2193
+ if (names.length > 0) {
2194
+ props.bind = addJsExprState(names.length === 1 ? names[0] : names.map((n) => `(${n})`).join(` + " · " + `));
2181
2195
  continue;
2182
2196
  }
2183
2197
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dongmingzhixiu/vuexir-compiler",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Vue SFC → IR → 原生源码(SwiftUI / Compose)编译器核心:纯函数、零 IO",
5
5
  "type": "module",
6
6
  "license": "MIT",