-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert some commits about SSR and refactor for adapting SSR (#519)
* 🚧 feat: wip * ♻ refactor: extract the CssProvider function as a base class * ♻ refactor: refactor the dispose func of JSModule * ♻ refactor: refactor the dispose func of JSObjectReferenceProxy * ♻ refactor: rename dispose to unbind * update outsideclick * 🚧 feat: wip * ♻ refactor(NextTickComponentBase): Use IAsyncDisposable instead of IDisposable * 🐛 fix: Routable doesn't work in SSR * remove srr script * remove unused code
- Loading branch information
Showing
34 changed files
with
185 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/Component/BlazorComponent.Web/src/ssr/ssr-state-restore.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/Component/BlazorComponent/Abstracts/Components/CssProviderComponentBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using BlazorComponent.Abstracts; | ||
|
||
namespace BlazorComponent; | ||
|
||
public class CssProviderComponentBase : ComponentBase | ||
{ | ||
protected CssProviderComponentBase() | ||
{ | ||
CssProvider = new(() => Class, () => Style); | ||
} | ||
|
||
public ComponentCssProvider CssProvider { get; } | ||
|
||
/// <summary> | ||
/// Specifies one or more class names for an DOM element. | ||
/// </summary> | ||
[Parameter] | ||
public string? Class { get; set; } | ||
|
||
/// <summary> | ||
/// Specifies an inline style for an DOM element. | ||
/// </summary> | ||
[Parameter] | ||
public string? Style { get; set; } | ||
|
||
protected override void OnInitialized() | ||
{ | ||
base.OnInitialized(); | ||
|
||
SetComponentClass(); | ||
SetComponentCss(); | ||
} | ||
|
||
[Obsolete("Use SetComponentCss instead")] | ||
protected virtual void SetComponentClass() | ||
{ | ||
} | ||
|
||
protected virtual void SetComponentCss() | ||
{ | ||
} | ||
} |
Oops, something went wrong.