Skip to content

Commit c579ce1

Browse files
authored
fix(Upload): preview function suppor wasm mode (#6889)
* fix(Upload): preview function suppor wasm mode * chore: bump version 9.11.2-beta06 * test: 更新单元测试
1 parent 5c0be2f commit c579ce1

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.11.2-beta05</Version>
4+
<Version>9.11.2-beta06</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/wwwroot/modules/upload.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,10 @@ export function preview(previewerId, index) {
9393
export function getPreviewUrl(id, fileName) {
9494
let url = '';
9595
const upload = Data.get(id);
96-
const { files } = upload;
97-
if (files) {
98-
const file = [...files].find(v => v.name === fileName);
99-
if (file) {
100-
url = URL.createObjectURL(file);
101-
}
96+
const { files, inputFile } = upload;
97+
const file = [...(files || inputFile.files)].find(v => v.name === fileName);
98+
if (file) {
99+
url = URL.createObjectURL(file);
102100
}
103101
return url;
104102
}

test/UnitTest/Components/TableTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8383,6 +8383,7 @@ public async Task OnAutoFitColumnWidthCallback_Ok()
83838383
pb.Add(a => a.AllowDragColumn, true);
83848384
pb.Add(a => a.ClientTableName, "table-unit-test");
83858385
pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
8386+
pb.Add(a => a.FitColumnWidthIncludeHeader, true);
83868387
pb.Add(a => a.OnAutoFitColumnWidthCallback, (fieldName, calcWidth) =>
83878388
{
83888389
name = fieldName;

0 commit comments

Comments
 (0)