Skip to content

Commit

Permalink
fix: SSR renderComponent computed error, #464 (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaonialife committed Aug 7, 2020
1 parent 6b9b33c commit 123e60e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/apis/computed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function computed<T>(
let computedSetter
let computedGetter

if (vm) {
if (vm && !vm.$isServer) {
const { Watcher, Dep } = getVueInternalClasses()
let watcher: any
computedGetter = () => {
Expand Down Expand Up @@ -75,6 +75,8 @@ export function computed<T>(
},
})

vm && vm.$on('hook:destroyed', () => computedHost.$destroy())

computedGetter = () => (computedHost as any).$$state
computedSetter = (v: T) => {
if (__DEV__ && !set) {
Expand Down

0 comments on commit 123e60e

Please sign in to comment.