@vitarx/plugin-vite 1.0.7 → 1.0.8
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.
|
@@ -109,6 +109,10 @@ function processChildExpression(expr, ctx) {
|
|
|
109
109
|
if (isMemberExpression(expr)) {
|
|
110
110
|
return handleMemberExpression(expr, ctx);
|
|
111
111
|
}
|
|
112
|
+
// 可选链初始可能为空,必须延迟读取,才能在信号变化后重新建立依赖。
|
|
113
|
+
if (t.isOptionalMemberExpression(expr) || t.isOptionalCallExpression(expr)) {
|
|
114
|
+
return wrapWithExpr(expr, ctx);
|
|
115
|
+
}
|
|
112
116
|
// 如果是条件表达式(如 ternary operator),递归处理条件表达式
|
|
113
117
|
if (isConditionalExpression(expr)) {
|
|
114
118
|
return processConditionalExpression(expr, ctx);
|