@dongmingzhixiu/vuexir-compiler 0.5.0 → 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,6 +2172,29 @@ function walkElement(node, classProps, comboRules, scopedRules, pseudoRules, war
2172
2172
  continue;
2173
2173
  }
2174
2174
  if (child.type === NodeTypes.ELEMENT) {
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(` + " · " + `));
2195
+ continue;
2196
+ }
2197
+ }
2175
2198
  // 常见写法兜底:<button><span>文字</span></button> → 内联文本并入 label(否则 IR 校验因缺 label 中断)
2176
2199
  const inner = elementInnerText(child).trim();
2177
2200
  if (inner) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dongmingzhixiu/vuexir-compiler",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Vue SFC → IR → 原生源码(SwiftUI / Compose)编译器核心:纯函数、零 IO",
5
5
  "type": "module",
6
6
  "license": "MIT",