{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# 使用 Blazor 进行交互式展示" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "在笔记本中使用Blazor:原生的没找到介绍和使用方法。但找到一大侠开发的扩展库-[BlazorInteractive](https://github.com/plbonneville/BlazorInteractive),使用前只要引入此nuget包即可。" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## 添加 Nuget 包" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [], "source": [ "// 可以先添加包源\n", "#i \"nuget:https://api.nuget.org/v3/index.json\"\n", "\n", "#r \"nuget: BlazorInteractive\"" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## 添加引用" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "dotnet_interactive": { "language": "csharp" }, "polyglot_notebook": { "kernelName": "csharp" } }, "outputs": [], "source": [ "#!blazor" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## 示例" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "dotnet_interactive": { "language": "razor" }, "polyglot_notebook": { "kernelName": "razor" } }, "outputs": [ { "data": { "text/html": [ "