Browse Source

无JIRA任务 chore: update demo

master
zsmj1994 4 years ago
parent
commit
15c19bdf90
  1. 29
      demo/js/fix-2.0/inject.js

29
demo/js/fix-2.0/inject.js

@ -9,7 +9,17 @@
} }
}; };
}, },
childContext: ["context"] childContext: ["context"],
actions: {
changeContext: function () {
this.model.context = {
two: {
key: "two.key"
}
};
}
}
}); });
BI.model("demo.model.inject.parent_store", ParentStore); BI.model("demo.model.inject.parent_store", ParentStore);
@ -24,8 +34,8 @@
actions: { actions: {
changeContext: function () { changeContext: function () {
this.model.context = { this.model.context = {
two: { one: {
key: "two.key" key: "one.changed_key"
} }
}; };
} }
@ -56,9 +66,6 @@
} }
}; };
}, },
mounted: function () {
}
}); });
BI.shortcut("demo.fix_inject_child", Child); BI.shortcut("demo.fix_inject_child", Child);
@ -70,11 +77,19 @@
render: function () { render: function () {
var self = this; var self = this;
return { return {
type: "bi.absolute", type: "bi.vertical",
items: [{ items: [{
el: { el: {
type: "demo.fix_inject_child" type: "demo.fix_inject_child"
} }
}, {
el: {
type: "bi.button",
text: "点击修改parent state",
handler: function () {
self.store.changeContext();
}
}
}] }]
}; };
}, },

Loading…
Cancel
Save