Skip to content

Commit

Permalink
fix: 修复报错后影响其他页面加载的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Oct 19, 2022
1 parent b132410 commit 589ecb9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/fast-crud/src/use/use-compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@ function doComputed(target, getContextFn, excludes, userComputedFn) {
target = target();
}

if (!isRef(target)) {
target = ref(target);
}
const raw = toRaw(target.value);
const targetRef = ref(target);
const raw = toRaw(targetRef);
const dependValues = findComputeValues(raw, excludes, false);

const dependAsyncValues = findComputeValues(raw, excludes, true);
Expand All @@ -93,7 +91,7 @@ function doComputed(target, getContextFn, excludes, userComputedFn) {
const asyncValuesMap = doAsyncCompute(dependAsyncValues, getContextFn);

return computed(() => {
let targetValue = target.value;
let targetValue = targetRef.value;
if (asyncCount > 0 || syncCount > 0) {
targetValue = cloneDeep(targetValue);
if (syncCount > 0) {
Expand Down

0 comments on commit 589ecb9

Please sign in to comment.