Skip to content

$add problem #873

Closed
Closed
@butsalt

Description

@butsalt
<div id="app"></div>
<div id="app2"></div>
var Vue = require("vue");

var data = global.data = {
    foo: {
        bar: "something"
    }
};

var app = global.app = new Vue({
    data: data,
    template: "<div>{{foo.bar}}</div><div>{{foo.bao}}</div>"
}).$mount("#app");

var app2 = global.app2 = new Vue({
    data: data.foo,
    template: "<div>{{bar}}</div>"
}).$mount("#app2");

Then I invoke $add in console

data.foo.$add("bao","koo")

Nothing happened.
I think that might because data.foo has been observed as app2's root $data. So when I invoke $add, it is helpfull with app2, but it will not trigger the deps that on data.foo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions