我正在使用 VS 2022 并創建了一個 Blazor WebAssembly ASP.NET Core 托管專案。我想在我的 Index.razor 上實作一個影像滑塊并嘗試使用 BlazorStrap。這是我正在使用的代碼:
@using BlazorStrap
<BSCarousel HasControls="true" HasIndicators="true" >
<BSCarouselItem>
<svg class="bd-placeholder-img bd-placeholder-img-lg d-block w-100" width="800" height="400" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: First slide" preserveAspectRatio="xMidYMid slice" focusable="false">
<rect width="100%" height="100%" fill="#777"></rect><text x="50%" y="50%" fill="#555" dy=".3em">First slide</text>
svg>
</BSCarouselItem>
<BSCarouselItem>
<svg class="bd-placeholder-img bd-placeholder-img-lg d-block w-100" width="800" height="400" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Second slide" preserveAspectRatio="xMidYMid slice" focusable="false">
<rect width="100%" height="100%" fill="#666"></rect><text x="50%" y="50%" fill="#444" dy=".3em">Second slide</text>
</svg>
</BSCarouselItem>
<BSCarouselItem>
<svg class="bd-placeholder-img bd-placeholder-img-lg d-block w-100" width="800" height="400" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Third slide" preserveAspectRatio="xMidYMid slice" focusable="false">
<rect width="100%" height="100%" fill="#555"></rect><text x="50%" y="50%" fill="#333" dy=".3em">Third slide</text>
</svg>
</BSCarouselItem>
</BSCarousel>
但是,如果我開始除錯它,我會收到此錯誤:


我需要做什么?我忘記了什么?
uj5u.com熱心網友回復:
您可能沒有在服務中注冊 BlazorStrap?
builder.Services.AddBlazorStrap();
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/411180.html
標籤:
