Additional javascript required for custom elements (#25102)

pull/25105/head
Bouke Haarsma 2022-02-22 20:45:52 +01:00 committed by GitHub
parent 38c652b693
commit 0f54e9e64b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -1124,6 +1124,12 @@ Register a root component as a custom element:
> [!NOTE]
> The preceding code example requires a namespace for the app's components (for example, `using BlazorSample.Pages;`) in the `Program.cs` file.
Include the following `<script>` tag in the app's HTML ***before*** the Blazor script tag:
```html
<script src="/_content/Microsoft.AspNetCore.Components.CustomElements/BlazorCustomElements.js"></script>
````
Use the custom element with any web framework. For example, the preceding counter custom element is used in a React app with the following markup:
```html