@dongmingzhixiu/vuexir-compiler 0.5.2 → 0.5.4

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.
@@ -1058,6 +1058,8 @@ export function vueToIr(source, opts = {}) {
1058
1058
  scopedRules: cs,
1059
1059
  pseudoRules: cps,
1060
1060
  propNames: script ? extractPropNames(script.content) : new Set(),
1061
+ // R139:组件内部的常量数组(const tabs = [...])也要能内联进 v-for
1062
+ constArrays: script ? extractScreenConstArrays(script.content) : {},
1061
1063
  refs: new Set(),
1062
1064
  });
1063
1065
  }
@@ -1671,8 +1673,12 @@ function buildComponentTree(comp, warnings) {
1671
1673
  if (roots.length !== 1 || roots[0].type !== NodeTypes.ELEMENT) {
1672
1674
  throw new VueCompileError(`组件 ${comp.name} 需单根元素(<template> 内仅一个根元素)`);
1673
1675
  }
1676
+ // R139:进组件模板前切换常量数组表为「组件自己的常量数组」,出栈后恢复
1677
+ const prevConsts = vforConsts;
1678
+ vforConsts = { ...prevConsts, ...comp.constArrays };
1674
1679
  const tree = walkElement(roots[0], comp.classProps, comp.comboRules, comp.scopedRules, comp.pseudoRules, warnings, undefined, [], // 组件内不支持嵌套组件
1675
1680
  comp.propNames);
1681
+ vforConsts = prevConsts;
1676
1682
  // 组件根布局 props 剥离 → 使用点
1677
1683
  const POSITION_KEYS = ['flex', 'width', 'marginTop', 'marginTopAuto', 'marginLeftAuto'];
1678
1684
  const position = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dongmingzhixiu/vuexir-compiler",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Vue SFC → IR → 原生源码(SwiftUI / Compose)编译器核心:纯函数、零 IO",
5
5
  "type": "module",
6
6
  "license": "MIT",