ECMAScript.Vue.Devtools 0.26.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package ECMAScript.Vue.Devtools --version 0.26.3
                    
NuGet\Install-Package ECMAScript.Vue.Devtools -Version 0.26.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ECMAScript.Vue.Devtools" Version="0.26.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ECMAScript.Vue.Devtools" Version="0.26.3" />
                    
Directory.Packages.props
<PackageReference Include="ECMAScript.Vue.Devtools" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ECMAScript.Vue.Devtools --version 0.26.3
                    
#r "nuget: ECMAScript.Vue.Devtools, 0.26.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ECMAScript.Vue.Devtools@0.26.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ECMAScript.Vue.Devtools&version=0.26.3
                    
Install as a Cake Addin
#tool nuget:?package=ECMAScript.Vue.Devtools&version=0.26.3
                    
Install as a Cake Tool

ECMAScript.Vue.Devtools

定位:@vue/devtools-api 8.1.5 的独立强类型 C# binding,用于 author custom Vue Devtools plugin,而不是浏览器扩展或 Devtools 内部实现的封装。

本包只提供 @vue/devtools-api 的 C# authoring contract,不重复携带运行时文件。运行时 资源由 Jazor.Vue 的 JS resource carrier(manifest.json + dist/**)提供;调用方编写的 插件模块仍由自身的 Jazor 工具生成到程序集 Jazor.Generated.ModuleCatalog

安装

<ItemGroup>
  <PackageReference Include="Jazor" Version="0.26.3" />
  <PackageReference Include="Jazor.Vue" Version="0.26.3" />
  <PackageReference Include="ECMAScript.Vue.Devtools" Version="0.26.3" />
</ItemGroup>

所有 Jazor、Jazor.VueECMAScript.* 包应使用相同版本。Jazor.Vue 提供 Vue、@vue/devtools-apiperfect-debounce 的本地 runtime closure;本包不会重复携带 browser ESM 或 Devtools extension internals。

使用

将 plugin 注册放在创建同一个 VueApp 的模块中。PluginApi 由 Devtools callback 提供,不能自行构造;Id 需要在 reload 之间保持稳定。

using System.ComponentModel;
using ECMAScript;
using static ECMAScript.VueDevtools;

[ECMAScript]
[Description("@#")]
public sealed record DiagnosticsSettings : Vue.VueProps
{
    public bool Verbose { get; init; }
}

[ECMAScript]
[Description("@#")]
public sealed record TimelineData : Vue.VueProps
{
    public string Message { get; init; } = "";
}

[ECMAScriptModule("devtools/diagnostics.mjs")]
public static class DiagnosticsDevtools
{
    public static void Install(Vue.VueApp app)
    {
        SetupPlugin<DiagnosticsSettings>(new PluginDescriptor<DiagnosticsSettings>
        {
            Id = "sample.diagnostics",
            Label = "Diagnostics",
            App = app,
            Settings = new PluginSettings
            {
                { "verbose", BooleanPluginSetting.Create(new BooleanPluginSettingOptions
                    { Label = "Verbose timeline", DefaultValue = false }) }
            }
        }, api =>
        {
            api.AddInspector(new InspectorOptions
            {
                Id = "sample.diagnostics.inspector",
                Label = "Diagnostics"
            });
            api.AddTimelineLayer<TimelineData, Vue.VueProps>(new TimelineLayerOptions<TimelineData, Vue.VueProps>
            {
                Id = "sample.diagnostics.timeline",
                Label = "Diagnostics",
                Color = 0x4F8BFF
            });
            api.On.GetInspectorTree(payload =>
            {
                payload.RootNodes = new Array<InspectorNode>(new InspectorNode
                {
                    Id = "root",
                    Label = "Application"
                });
            });
            api.AddTimelineEvent<TimelineData, Vue.VueProps>(new TimelineEventOptions<TimelineData, Vue.VueProps>
            {
                LayerId = "sample.diagnostics.timeline",
                Event = new TimelineEvent<TimelineData, Vue.VueProps>
                {
                    Time = api.Now(),
                    Title = "Plugin installed",
                    Data = new TimelineData { Message = "ready" }
                }
            });
        });
    }
}

PluginSetting、custom tab view 与 custom command action 是带 discriminator 的结果类型。请使用 BooleanPluginSetting.Create(...)IframeView.Create(...)CustomCommandUrlAction.Create(...) 等 factory,让 emitted object 始终带有官方 type literal;不要依赖 C# property default 初始化器写入 JavaScript structural object。

覆盖范围

  • setupDevToolsPlugin()、plugin descriptor 与 typed settings。
  • custom inspector、tree/state lifecycle、state editing 与 inspector action。
  • component tree/state hooks、component query/highlight 与 update notification。
  • timeline layer/event、timeline inspection、screenshot overlay 与 clear hook。
  • custom tab、command palette、Devtools/Devtools-client connection callback。

边界

  • 本包仅绑定 @vue/devtools-api 的 public plugin authoring surface;不暴露 @vue/devtools-kit、浏览器 extension、Vite/Electron RPC 或 private Devtools runtime shape。
  • Pinia 4 在 app.Use(pinia) 时会自行注册其开发面板。不要为已有 Pinia panel 再手工调用 SetupPlugin(...)
  • Devtools 可以不存在于生产环境或用户浏览器。官方 API 会处理未连接状态;application business logic 不应依赖 plugin callback 一定执行。

示例与验证

相关文档

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.28.0 0 9/2/2026
0.27.0 0 9/2/2026
0.26.3 47 8/31/2026
0.26.1 53 8/31/2026
0.26.0 40 8/31/2026
0.25.0 54 8/28/2026
0.24.0 72 8/27/2026
0.23.0 81 8/26/2026
0.22.0 82 8/25/2026
0.21.0 84 8/25/2026
0.20.0 84 8/24/2026
0.17.0 96 8/19/2026
0.16.3 87 8/18/2026
0.16.2 101 8/17/2026
0.16.1 95 8/17/2026
0.16.0 85 8/16/2026
0.15.0 94 8/15/2026