8000 handle data functions that return nothing · nerona/vue@b80ae34 · GitHub
[go: up one dir, main page]

Skip to 8000 content

Commit b80ae34

Browse files
committed
handle data functions that return nothing
1 parent 86253b0 commit b80ae34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/instance/internal/state.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default function (Vue) {
7676

7777
Vue.prototype._initData = function () {
7878
var dataFn = this.$options.data
79-
var data = this._data = dataFn ? dataFn() : {}
79+
var data = this._data = dataFn ? dataFn() || {} : {}
8080
var props = this._props
8181
var runtimeData = this._runtimeData
8282
? typeof this._runtimeData === 'function'

0 commit comments

Comments
 (0)
0