File tree Expand file tree Collapse file tree
src/BootstrapBlazor/Components/Upload Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,6 +148,22 @@ protected override void OnParametersSet()
148148 } ;
149149 }
150150
151+ /// <summary>
152+ /// <inheritdoc/>
153+ /// </summary>
154+ /// <returns></returns>
155+ protected override bool CheckCanUpload ( )
156+ {
157+ // 允许多上传
158+ if ( IsMultiple )
159+ {
160+ return ! MaxFileCount . HasValue || GetUploadFiles ( ) . Count < MaxFileCount ;
161+ }
162+
163+ // 只允许单个上传
164+ return UploadFiles . Count == 0 ;
165+ }
166+
151167 /// <summary>
152168 /// 获得 数据验证客户端 ID
153169 /// </summary>
Original file line number Diff line number Diff line change @@ -258,12 +258,6 @@ protected override void OnParametersSet()
258258 /// <returns></returns>
259259 protected override bool CheckCanUpload ( )
260260 {
261- // 如果组件禁用了 IsDisabled 允许上传但是不出现 + 按钮
262- if ( IsDisabled )
263- {
264- return true ;
265- }
266-
267261 // 允许多上传
268262 if ( IsMultiple )
269263 {
You can’t perform that action at this time.
0 commit comments