@dongmingzhixiu/vuexir-compiler 0.3.7 → 0.3.9
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/dist/transform/vue2ir.js +10 -1
- package/package.json +1 -1
package/dist/transform/vue2ir.js
CHANGED
|
@@ -314,6 +314,15 @@ ${computedStates
|
|
|
314
314
|
.join('\n')}
|
|
315
315
|
}
|
|
316
316
|
__vrnRecompute();
|
|
317
|
+
// R102:异步数据(store init / db 读取)落地后派生值要能跟上——启动后 2s 内持续重算
|
|
318
|
+
(function () {
|
|
319
|
+
var __n = 0;
|
|
320
|
+
function __tick() {
|
|
321
|
+
__vrnRecompute();
|
|
322
|
+
if (++__n < 20 && typeof setTimeout === "function") setTimeout(__tick, 100);
|
|
323
|
+
}
|
|
324
|
+
__tick();
|
|
325
|
+
})();
|
|
317
326
|
`;
|
|
318
327
|
const initPairs = states.map((s) => {
|
|
319
328
|
// M4b 动态列表态:list → JS 真数组('[]' 或 '["a","b"]' JSON 字面量,Swift JSONSerialization 可解码)
|
|
@@ -459,7 +468,7 @@ var router = {
|
|
|
459
468
|
};
|
|
460
469
|
// handlers(<script setup> 函数体:ref.value → stateStore 重写)
|
|
461
470
|
${handlerSrc}
|
|
462
|
-
${computedBlock}// onMounted(Swift onAppear → invoke("__onMounted"))
|
|
471
|
+
${computedBlock}${"" /* R102 见 computedBlock 内:仅当存在派生状态时才调度重算循环,避免无谓的定时器 */}// onMounted(Swift onAppear → invoke("__onMounted"))
|
|
463
472
|
${onMounted !== undefined ? `${onMountedAsync ? 'async ' : ''}function __onMounted() {\n${indentBody(onMounted)}\n}` : ''}`;
|
|
464
473
|
}
|
|
465
474
|
/** 简单缩进(handler 体统一 2 空格缩进) */
|