use-js-interop

安装量: 992
排名: #10519

安装

npx skills add https://github.com/dotnet/skills --skill use-js-interop

JS Interop in Blazor 1. Collocated JS Modules Always use collocated .razor.js files with export — never global window.* functions or

<script> tags. // ChartPanel.razor.js — placed next to ChartPanel.razor export function initialize ( canvas , dotNetRef ) { /* ... */ } export function updateData ( points ) { /* ... */ } export function dispose ( ) { /* ... */ } Import paths: same project = "./Components/ChartPanel.razor.js" , RCL = "./_content/{AssemblyName}/..." . 2. Lifecycle Timing All JS interop must happen in OnAfterRenderAsync or event handlers — never in OnInitialized , OnParametersSet , or constructors. JS is not available during server prerendering. Show more Installs 970 Repository dotnet/skills GitHub Stars 5.3K First Seen May 26, 2026 Security Audits Gen Agent Trust Hub Pass Socket Pass Snyk Fail
返回排行榜