mirror of https://github.com/abpframework/abp.git
6 changed files with 48 additions and 49 deletions
@ -1,25 +0,0 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.CmsKit.ViewComponents; |
|||
|
|||
[Widget( |
|||
AutoInitialize = true |
|||
)] |
|||
|
|||
[ViewComponent(Name = "CommentDate")] |
|||
public class CommentDateViewComponent : AbpViewComponent |
|||
{ |
|||
public bool IsShow { get; set; } |
|||
|
|||
public CommentDateViewComponent() |
|||
{ |
|||
} |
|||
|
|||
public virtual async Task<IViewComponentResult> InvokeAsync(string isShow) |
|||
{ |
|||
return View("~/ViewComponents/CommentDate.cshtml", new CommentDateViewComponent() { IsShow = bool.Parse(isShow) }); |
|||
} |
|||
} |
|||
@ -1,4 +1,4 @@ |
|||
@model Volo.CmsKit.ViewComponents.CommentDateViewComponent |
|||
@model Volo.CmsKit.ViewComponents.ExampleDateViewModel |
|||
|
|||
<p>Welcome Comment Date Component</p> |
|||
@if (Model.IsShow) |
|||
@ -0,0 +1,29 @@ |
|||
using System.ComponentModel; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.CmsKit.ViewComponents; |
|||
|
|||
[Widget( |
|||
AutoInitialize = true |
|||
)] |
|||
|
|||
[ViewComponent(Name = "ExampleDate")] |
|||
public class ExampleDateViewComponent : AbpViewComponent |
|||
{ |
|||
public ExampleDateViewComponent() |
|||
{ |
|||
} |
|||
|
|||
public virtual async Task<IViewComponentResult> InvokeAsync(string isShow) |
|||
{ |
|||
return View("~/ViewComponents/ExampleDate.cshtml", new ExampleDateViewModel() { IsShow = bool.Parse(isShow) }); |
|||
} |
|||
} |
|||
|
|||
public class ExampleDateViewModel |
|||
{ |
|||
public bool IsShow { get; set; } |
|||
} |
|||
@ -1,5 +1,5 @@ |
|||
@using Volo.CmsKit.ViewComponents |
|||
@model DecisionCommentDateViewModel |
|||
@model ExampleModalDateViewModel |
|||
|
|||
<div class="form-check mb-3"> |
|||
<abp-input asp-for="IsShow" /> |
|||
Loading…
Reference in new issue