Skip to content

Commit 54f5f9b

Browse files
committed
chore: fix ssr tests
1 parent c9136b1 commit 54f5f9b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/instance/state.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export function initState(vm: Component) {
6060
if (opts.data) {
6161
initData(vm)
6262
} else {
63-
observe((vm._data = {}))!.vmCount++
63+
const ob = observe((vm._data = {}))
64+
ob && ob.vmCount++
6465
}
6566
if (opts.computed) initComputed(vm, opts.computed)
6667
if (opts.watch && opts.watch !== nativeWatch) {
@@ -154,7 +155,8 @@ function initData(vm: Component) {
154155
}
155156
}
156157
// observe data
157-
observe(data)!.vmCount++
158+
const ob = observe(data)
159+
ob && ob.vmCount++
158160
}
159161

160162
export function getData(data: Function, vm: Component): any {

0 commit comments

Comments
 (0)