Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vue
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dev
Choose a base ref
...
head repository: kenyk7/vue
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dev
Choose a head ref

There isn’t anything to compare.

vuejs:dev and kenyk7:dev are entirely different commit histories.

Showing with 19 additions and 14 deletions.
  1. +17 −0 src/instance/internal/state.js
  2. +2 −14 src/instance/vue.js
17 changes: 17 additions & 0 deletions src/instance/internal/state.js
Original file line number Diff line number Diff line change
@@ -17,6 +17,23 @@ import {

export default function (Vue) {

/**
* Accessor for `$data` property, since setting $data
* requires observing the new object and updating
* proxied properties.
*/

Object.defineProperty(Vue.prototype, '$data', {
get () {
return this._data
},
set (newData) {
if (newData !== this._data) {
this._setData(newData)
}
}
})

/**
* Setup the scope of an instance, which contains:
* - observed data
16 changes: 2 additions & 14 deletions src/instance/vue.js
Original file line number Diff line number Diff line change
@@ -24,20 +24,8 @@ import lifecycleAPI from './api/lifecycle'
* @public
*/

class Vue {
constructor (options) {
this._init(options)
}

get $data () {
return this._data
}

set $data (newData) {
if (newData !== this._data) {
this._setData(newData)
}
}
function Vue (options) {
this._init(options)
}

// install internals