fix(ssr): make computed inactive during ssr, fix memory leak

fix #5208
This commit is contained in:
Evan You
2022-01-16 18:22:18 +08:00
parent 4d07ed809c
commit f4f0966b33
3 changed files with 15 additions and 5 deletions

View File

@@ -0,0 +1,7 @@
import { computed as _computed } from '@vue/reactivity'
import { isInSSRComponentSetup } from './component'
export const computed = ((getterOrOptions: any, debugOptions?: any) => {
// @ts-ignore
return _computed(getterOrOptions, debugOptions, isInSSRComponentSetup)
}) as typeof _computed

View File

@@ -3,7 +3,6 @@
export const version = __VERSION__
export {
// core
computed,
reactive,
ref,
readonly,
@@ -34,6 +33,7 @@ export {
getCurrentScope,
onScopeDispose
} from '@vue/reactivity'
export { computed } from './apiComputed'
export {
watch,
watchEffect,