ant-design-blazor/components/upload/UploadButton.razor
James Yeung 11bfaef22e feat(module: upload): support drag (#1765)
* feat(module: upload): support drag

* fix button text

* add tests

* delete useless field
2021-07-24 21:29:31 +08:00

26 lines
848 B
C#

@namespace AntDesign.Internal
@inherits AntDomComponentBase
<div class="@ClassMapper.Class" style="@(!ShowButton?"display:none;":"")">
<div tabindex="0" class="ant-upload" style="position:relative;" @ref="_btn" data-fileid="@_fileId" role="button">
<input type="file"
webkitdirectory="@Directory"
multiple="@(Multiple || Directory)"
@ref="_file"
@onchange="FileNameChanged"
accept="@Accept"
style="@(Upload?.Drag==true?"position: absolute;width: 100%;height: 100%;opacity: 0;top: 0;left: 0;z-index:2;":"display:none;")"
id="@_fileId" />
@if (Upload?.Drag == true)
{
<div class="ant-upload-drag-container">
@ChildContent
</div>
}
else
{
@ChildContent
}
</div>
</div>