diff --git a/lib/Select/select.controller.js b/lib/Select/select.controller.js index 8e1edfa..8e36f8f 100644 --- a/lib/Select/select.controller.js +++ b/lib/Select/select.controller.js @@ -34,6 +34,15 @@ class SelectController { $scope.$on('$destroy', () => { this.destory(); }); + + // fix:当ngModel被重置为空时清除选择项 + $scope.$watch(() => { + return this.ngModel + }, newVal => { + if (!newVal) { + this.clearSelected(null); + } + }) } @@ -77,7 +86,7 @@ class SelectController { /** * 没有填充好数据的组件,也能设置好 - * 设置好数据的组件,就要匹配内容 + * 设置好数据的组件,就要匹配内容 */ if (this.dataArray && this.dataArray.length > 0) { this.dataArray.map((group) => { @@ -442,7 +451,7 @@ class SelectController { }).then((data) => { /** * fix https://github.com/ffan-fe/fancyui/issues/43 - + if (!data || data.length == 0) { this.ngModel = {}; }*/ diff --git a/lib/Upload/upload.html b/lib/Upload/upload.html index bb11c36..e0ade08 100644 --- a/lib/Upload/upload.html +++ b/lib/Upload/upload.html @@ -7,7 +7,7 @@ ng-transclude>
-
+