feat(data-source): 数据源新增setValue方法

This commit is contained in:
roymondchen 2024-07-16 16:24:32 +08:00
parent 059c0056c4
commit 8d111ea976

View File

@ -122,6 +122,10 @@ export default class DataSource<T extends DataSourceSchema = DataSourceSchema> e
this.emit('change', changeEvent);
}
public setValue(path: string, data: any) {
return this.setData(data, path);
}
public onDataChange(path: string, callback: (newVal: any) => void) {
this.#observedData.on(path, callback);
}