Skip to content

Custom directive's deep doesn't work when add key to a json object #2385

@brucesong08

Description

@brucesong08

I want to custom a directive with a json Object. When I add new key to the json object, the directive doesn't work.
Example:

props: {
node: {
attr:{}
}
},

directives:{
updAttr:{
deep: true,
update:function{
/_do something_**/
}
}
////add a key it doesn't work
node.attr['a'] = "test";

////if clone a new obj, it works
var attr = jQuery.extend(true, {}, node.attr);
attr["a"] = "test";
node.attr = attr;

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