@sola-air-ui/compiler 1.5.0 → 1.5.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sola-air-ui/compiler",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Compiler for Sola single-file components (.sola) \u2014 transforms template + script + style to ES modules",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -1587,7 +1587,11 @@ export function compile(source, options = {}) {
1587
1587
  domCode += ` ${id}.addEventListener('input', (e) => { set_${bound}(e.target.value); });\n`;
1588
1588
  domCode += ` createEffect(() => { ${id}.value = ${bound}() ?? ''; });\n`;
1589
1589
  } else if (prop === 'this') {
1590
- domCode += ` ${bound} = ${id};\n`;
1590
+ if (stateVars.has(bound)) {
1591
+ domCode += ` set_${bound}(${id});\n`;
1592
+ } else {
1593
+ domCode += ` ${bound} = ${id};\n`;
1594
+ }
1591
1595
  }
1592
1596
  } else if (key === 'class' || key === 'className') {
1593
1597
  // Static values: emit as a plain string literal. A template literal here