Browse Source
feat: add AppBasePath parameter to script and style bundling components
pull/22514/head
maliming
1 year ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
18 additions and
2 deletions
-
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Bundling/AbpScripts.razor
-
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Bundling/AbpStyles.razor
|
|
|
@ -5,7 +5,12 @@ |
|
|
|
{ |
|
|
|
foreach (var file in ScriptFiles) |
|
|
|
{ |
|
|
|
<script src="@file"></script> |
|
|
|
var src = file; |
|
|
|
if (!AppBasePath.IsNullOrWhiteSpace()) |
|
|
|
{ |
|
|
|
src = AppBasePath.EnsureEndsWith('/') + file.RemovePreFix("/"); |
|
|
|
} |
|
|
|
<script src="@src"></script> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -19,6 +24,9 @@ |
|
|
|
[Parameter] |
|
|
|
public string? BundleName { get; set; } |
|
|
|
|
|
|
|
[Parameter] |
|
|
|
public string? AppBasePath { get; set; } |
|
|
|
|
|
|
|
private List<string>? ScriptFiles { get; set; } |
|
|
|
|
|
|
|
private PersistingComponentStateSubscription _persistingSubscription; |
|
|
|
|
|
|
|
@ -5,7 +5,12 @@ |
|
|
|
{ |
|
|
|
foreach (var file in StyleFiles) |
|
|
|
{ |
|
|
|
<link rel="stylesheet" href="@file" /> |
|
|
|
var href = file; |
|
|
|
if (!AppBasePath.IsNullOrWhiteSpace()) |
|
|
|
{ |
|
|
|
href = AppBasePath.EnsureEndsWith('/') + file.RemovePreFix("/"); |
|
|
|
} |
|
|
|
<link rel="stylesheet" href="@href" /> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -19,6 +24,9 @@ |
|
|
|
[Parameter] |
|
|
|
public string? BundleName { get; set; } |
|
|
|
|
|
|
|
[Parameter] |
|
|
|
public string? AppBasePath { get; set; } |
|
|
|
|
|
|
|
private List<string>? StyleFiles { get; set; } |
|
|
|
|
|
|
|
private PersistingComponentStateSubscription _persistingSubscription; |
|
|
|
|