mirror of https://github.com/vuejs/vue.git
fix #172 `parent` option in Vue.extend
This commit is contained in:
parent
5eddfd0514
commit
2ddcae6044
|
|
@ -576,7 +576,9 @@ CompilerProto.createBinding = function (key, directive) {
|
|||
// nested path on computed property
|
||||
compiler.defineExp(key, binding)
|
||||
} else {
|
||||
// ensure path in data so it can be observed
|
||||
// ensure path in data so that computed properties that
|
||||
// access the path don't throw an error and can collect
|
||||
// dependencies
|
||||
Observer.ensurePath(compiler.data, key)
|
||||
var parentKey = key.slice(0, key.lastIndexOf('.'))
|
||||
if (!bindings[parentKey]) {
|
||||
|
|
|
|||
|
|
@ -173,7 +173,11 @@ function inheritOptions (child, parent, topLevel) {
|
|||
} else {
|
||||
child[key].push(parentVal)
|
||||
}
|
||||
} else if (topLevel && (type === 'Object' || parentType === 'Object')) {
|
||||
} else if (
|
||||
topLevel &&
|
||||
(type === 'Object' || parentType === 'Object')
|
||||
&& !(parentVal instanceof ViewModel)
|
||||
) {
|
||||
// merge toplevel object options
|
||||
child[key] = inheritOptions(val, parentVal)
|
||||
} else if (val === undefined) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue