现在在用asp.net的Blazor+Radzen制作一个todolist,使用的是Radzen的Scheduler组件,但是我复制Radzen给出的实例代码,出现了报错。错误是说我缺少引用命名空间,我缺少了什么命名空间呢?系统没有提示
EventConsole console;
//中间一部分没问题代码我省略了
async Task OnSlotSelect(SchedulerSlotSelectEventArgs args)
{
//如果我把第一行的Eventconsole注释掉,下面的console.Log中console就会标红线
console.Log($"SlotSelect: Start={args.Start} End={args.End}");
DataItem data = await DialogService.OpenAsync<AddAppointmentPage>("Add Appointment",
new Dictionary<string, object> { { "Start", args.Start }, { "End", args.End } });
if (data != null)
{
appointments.Add(data);
// Either call the Reload method or reassign the Data property of the Scheduler
await scheduler.Reload();
}
}
引用的命名空间在这里,相应的radzen需要的配置代码我都输入了
@using System
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using CementStatistic
@using CementStatistic.Shared
@using Radzen
@using Radzen.Blazor