mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-13 00:47:33 +08:00
修复Collection对象set数据时,对象中的数组值未更新的问题
This commit is contained in:
@@ -20,7 +20,12 @@ export class Collection<K, V> extends Map<K, V>{
|
||||
* @param value 数据值
|
||||
*/
|
||||
set(key: K, value: V) {
|
||||
if (!this.has(key)) {
|
||||
if (this.has(key)) {
|
||||
var old = this.get(key)!;
|
||||
var index = this._array.indexOf(old);
|
||||
this._array[index] = value;
|
||||
}
|
||||
else {
|
||||
this._array.push(value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user