Skip to content

Instantly share code, notes, and snippets.

@0use-TE
Created December 2, 2025 00:55
Show Gist options
  • Select an option

  • Save 0use-TE/11eed551de15ea3f7f41cdbdce8a48d3 to your computer and use it in GitHub Desktop.

Select an option

Save 0use-TE/11eed551de15ea3f7f41cdbdce8a48d3 to your computer and use it in GitHub Desktop.
Blazor如何实现Home.razor.js
  1. 按照规则创建js文件,比如./Components/Pages/Home.razor.js
  2. js内必须设置为导出
  3. 同级的Blazor中执行JSRuntime.InvokeAsync("import","./Comonents/Pages/Home.razor.js")路径要从项目根路径写起
  4. 得到导出的模块,使用InvokeAsync...etc 即可
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment