wip(ssr): reduce reactivity overhead during ssr

This commit is contained in:
Evan You
2020-01-24 11:39:52 -05:00
parent cee36ad028
commit 25a0d4a65f
7 changed files with 50 additions and 21 deletions

View File

@@ -56,6 +56,10 @@ export function computed<T>(
// expose effect so computed can be stopped
effect: runner,
get value() {
if (__SSR__) {
return getter()
}
if (dirty) {
value = runner()
dirty = false