Created
February 14, 2021 03:03
-
-
Save Nillth/d9aae0569074e7fdbad7a0d2e0c3a57a to your computer and use it in GitHub Desktop.
Blazor Summerote example
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
public class ContentObj | |
{ | |
public Guid id = Guid.NewGuid(); | |
public string content; | |
} |
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
@*using https://www.nuget.org/packages/BlazingComponents.Summernote/*@ | |
<div style="width:99%;min-width:50px;"> | |
<BlazingComponents.Summernote.Editor @bind-content="@_content" /> | |
</div> | |
<h2>@_content</h2> | |
@code{ | |
private string _content; | |
} |
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
@*using https://www.nuget.org/packages/BlazingComponents.Summernote/*@ | |
<div> | |
<div> | |
<ul> | |
@foreach (var contentobj in _contentslist) | |
{ | |
<li> | |
<BlazingComponents.Summernote.Editor @bind-content="@contentobj.content" /> | |
</li> | |
} | |
</ul> | |
</div> | |
<div> | |
<button class="btn btn-primary" @onclick="Add"> | |
<span class="oi oi-plus"></span> | |
</button> | |
</div> | |
</div> | |
@code{ | |
// Add a ContentObjct Class | |
private List<ContentObj> _contentslist = new List<ContentObj>(); | |
private void Add() | |
{ | |
_contentslist.Add(new ContentObj()); | |
StateHasChanged(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment