Browse Source

fix: blazor `<AbpStyles>`/`<AbpScripts>` lose `PathBase` for `WebAssemblyStyleFiles`/`WebAssemblyScriptFiles`

Resolve `WebAssemblyStyleFiles` and `WebAssemblyScriptFiles` through `IComponentBundleUrlBuilder` so they receive the same `PathBase` prefixing as the prerender bundle files.
pull/25340/head
maliming 5 months ago
parent
commit
a7610e51cb
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 2
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Bundling/AbpScripts.razor
  2. 4
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Bundling/AbpStyles.razor

2
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Bundling/AbpScripts.razor

@ -45,7 +45,7 @@
{
if (OperatingSystem.IsBrowser() && WebAssemblyScriptFiles != null)
{
ScriptFiles = WebAssemblyScriptFiles;
ScriptFiles = await ResolveAsync(WebAssemblyScriptFiles);
}
}
}

4
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Bundling/AbpStyles.razor

@ -46,7 +46,7 @@
StyleFiles = scriptFiles;
if (OperatingSystem.IsBrowser() && StyleFiles != null && WebAssemblyStyleFiles != null)
{
StyleFiles.AddIfNotContains(WebAssemblyStyleFiles);
StyleFiles.AddIfNotContains(await ResolveAsync(WebAssemblyStyleFiles));
}
}
}
@ -59,7 +59,7 @@
{
_hasRemoveServerStyle = true;
await Task.Delay(3000);
StyleFiles = WebAssemblyStyleFiles;
StyleFiles = await ResolveAsync(WebAssemblyStyleFiles);
StateHasChanged();
}
}

Loading…
Cancel
Save