你好,我有一个正在使用的问题blazor,aspnet core我已经有一个组件,uploads files在上传时它会显示一个包含我上传的文件数据的表格,但我希望在上传文件时它只显示名称和一段progress bar时间文件已加载,但我不知道该怎么做。
这是我上传文件的代码:
\n<h3 class="text-center">Subir Archivo</h3>\n\n<div class="input-group col-md-4">\n <div class="input-group-prepend">\n <span class="input-group-text"></span>\n </div>\n <div class="custom-file">\n <InputFile class="custom-file-input" id="inputGroupFile01" lang="es" multiple OnChange="HandleSelection" />\n <label class="custom-file-label" for="inputGroupFile01">Seleccionar Archivo...</label>\n </div>\n</div>\n<br />\n@if (selectedFiles != null)\n{\n <table class="table table-hover text-center">\n <thead>\n <tr>\n <th>Nombre</th>\n <th>Tama\xc3\xb1o en bytes</th>\n <th>Fecha de Modificaci\xc3\xb3n</th>\n <th>Tipo de Archivo</th>\n </tr>\n </thead>\n <tbody>\n @foreach (var file in selectedFiles)\n {\n <tr>\n <td>@file.Name</td>\n <td>@file.Size</td>\n <td>@file.LastModified</td>\n <td>@file.Type</td>\n </tr>\n }\n </tbody>\n </table>\n}\n\n@code {\n IFileListEntry[] selectedFiles;\n\n …Run Code Online (Sandbox Code Playgroud) 你可以帮帮我吗?我想在 Blazor WebAssembly 中制作一个通用的树视图组件,但我有点迷失于如何做到这一点,我希望能够将任何类型的对象列表传递给组件,目前我已经做了一些非常简单的事情,使用名为目录的对象加载组件,但我想将其替换为 Titem,以便能够发送任何类型的列表
索引剃刀
@page "/index"
<h1>Treeview</h1>
<Treeview Directorios="directorios"></Treeview>
@code {
public Directorio[] directorios;
protected async override Task OnInitializedAsync()
{
var fall2014 = new Directorio("Fall 2014", new Directorio[] { }, new string[] { "image1.jpg", "image2.jpg", "image3.jpg" });
var summer2014 = new Directorio("Summer 2014", new Directorio[] { }, new string[] { "image10.jpg", "image20.jpg", "image30.jpg" });
var pictures = new Directorio("Pictures", new Directorio[] { fall2014, summer2014 }, new string[] { });
var music = new Directorio("Music", new Directorio[] { }, …Run Code Online (Sandbox Code Playgroud) 我有一个问题:如何隐藏一些按钮并在单击另一个按钮时使它们可见?我正在使用 Blazor 和 ASP.NET Core,并且我见过几个示例,但它们是用 Javascript 和 jQuery 编写的,而不是用 C# 编写的。
\n这是将执行事件以显示按钮的按钮:
\n<button class="btn btn-dark" @onclick="GuardarCotizacion"><i class="fa fa-floppy-o" aria-hidden="true"></i> Guardar Cotizaci\xc3\xb3n</button>\nRun Code Online (Sandbox Code Playgroud)\n这些是我想要隐藏在下拉菜单中的按钮:
\n<div class="box-footer">\n <div class="pull-right">\n <div class="btn-group">\n <div class="btn-group">\n <div class="dropdown">\n <button class="btn btn-info dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Correo</button>\n <div class="dropdown-menu" aria-labelledby="dropdownMenu1">\n <button class="dropdown-item" type="button" @onclick="@DescargarPDF"><i class="oi oi-envelope-closed"></i> Descargar Cotizaci\xc3\xb3n</button>\n <button class="dropdown-item" type="button"><i class="oi oi-eye"></i> Ver Correo</button>\n </div>\n </div>\n </div>\n\n <button type="button" class="btn btn-outline-info" @onclick="@AgregarProducto"><i class='fa fa-plus'></i> Agregar productos</button>\n </div>\n </div> \n\n <div class="btn-group">\n …Run Code Online (Sandbox Code Playgroud)