0
如果viewModel.data()的任何可觀察元素髮生了更改,還是需要遍歷並訂閱每個獨立的observables,是否有單個發射器可以觸發?有沒有辦法檢測觀察對象的嵌套結構的任何元素是否發生了變化?
data: ko.observable([
{
name: "Chart Position",
fields: ko.observableArray([
{name: "marginBottom", type: "percOrNumber", value: ko.observable(), valueType: ko.observable()},
{name: "marginLeft", type: "percOrNumber", value: ko.observable(), valueType: ko.observable()},
{name: "marginRight", type: "percOrNumber", value: ko.observable(), valueType: ko.observable()},
{name: "marginTop", type: "percOrNumber", value: ko.observable(), valueType: ko.observable()}
])
}
]),
啊,這真的很酷,謝謝RP! –