小编Jus*_*ler的帖子

WebAssembly Blazor .NET 6.0 未检索 MudBlazor 样式 - 找不到“mudElementRef.getBoundingClientRect”

我创建了一个 PWA,并希望使用 MudBlazor 作为 UI,从 MudBlazor 模板“Wasm-PWA”项目中获取代码。到目前为止,我已经尝试过 Chrome 和 Edge,将 MudBlazor 模板项目与我自己的 PWA 项目进行比较,但无法发现差异。我也尝试过删除广告拦截,但没有取得任何成功。

PWA 中缺乏 Mudblazor 样式

页面上的错误是:

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
      Error: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
          at https://localhost:44368/_framework/blazor.webassembly.js:1:328
          at Array.forEach (<anonymous>)
          at a.findFunction (https://localhost:44368/_framework/blazor.webassembly.js:1:296)
          at _ (https://localhost:44368/_framework/blazor.webassembly.js:1:2437)
          at https://localhost:44368/_framework/blazor.webassembly.js:1:3325
          at new Promise (<anonymous>)
          at Object.beginInvokeJSFromDotNet (https://localhost:44368/_framework/blazor.webassembly.js:1:3306)
          at Object.St [as invokeJSFromDotNet] (https://localhost:44368/_framework/blazor.webassembly.js:1:59849)
          at _mono_wasm_invoke_js_blazor (https://localhost:44368/_framework/dotnet.6.0.4.p3odw0yl22.js:1:195300)
          at wasm://wasm/00970c26:wasm-function[219]:0x1a0fb
Microsoft.JSInterop.JSException: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
Error: Could not …
Run Code Online (Sandbox Code Playgroud)

c# progressive-web-apps blazor mudblazor

6
推荐指数
1
解决办法
6450
查看次数

标签 统计

blazor ×1

c# ×1

mudblazor ×1

progressive-web-apps ×1