Skip to content

Commit 3973f80

Browse files
authored
[破坏性修改] 当select控件的trackItemBy属性有效时,根据trackItemBy所指的属性的值来判定value值是否有变更
1 parent 432b2fe commit 3973f80

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/jigsaw/pc-components/select/select.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@ export class JigsawSelect extends AbstractJigsawComponent implements ControlValu
245245
if (this._value == newValue) {
246246
return;
247247
}
248+
let trackItemBy: string[];
249+
if (this.trackItemBy) {
250+
trackItemBy = Object.prototype.toString.call(this.trackItemBy) == '[object Array]' ? <string[]>this.trackItemBy : [this.trackItemBy.toString()];
251+
}
252+
if (this.initialized && CommonUtils.compareWithKeyProperty(this._value, newValue, trackItemBy)) {
253+
return;
254+
}
248255
this._propagateChange(newValue);
249256
this._value = newValue;
250257
if (this.initialized) {

0 commit comments

Comments
 (0)