Removed unnecessary preceding @s (#11520)

This commit is contained in:
Ajay Bhargav Baaskaran 2019-06-24 18:04:44 -07:00 committed by GitHub
parent 397a27f810
commit bff743aced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 104 additions and 104 deletions

View File

@ -445,7 +445,7 @@ namespace Test
// Act // Act
var component = CompileToComponent(@" var component = CompileToComponent(@"
<p @onmouseover=""@OnComponentHover"" style=""background: @ParentBgColor;"" /> <p @onmouseover=""OnComponentHover"" style=""background: @ParentBgColor;"" />
@code { @code {
public string ParentBgColor { get; set; } = ""#FFFFFF""; public string ParentBgColor { get; set; } = ""#FFFFFF"";

View File

@ -498,7 +498,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
{ {
// Arrange // Arrange
var component = CompileToComponent(@" var component = CompileToComponent(@"
<button @onclick=""@(x => Clicked = true)"" /> <button @onclick=""x => Clicked = true"" />
@code { @code {
public bool Clicked { get; set; } public bool Clicked { get; set; }
}"); }");
@ -530,7 +530,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
{ {
// Arrange // Arrange
var component = CompileToComponent(@" var component = CompileToComponent(@"
<button @onclick=""@OnClick"" /> <button @onclick=""OnClick"" />
@code { @code {
public void OnClick(UIMouseEventArgs e) { Clicked = true; } public void OnClick(UIMouseEventArgs e) { Clicked = true; }
public bool Clicked { get; set; } public bool Clicked { get; set; }

View File

@ -4,19 +4,19 @@
<h2>JSON performance</h2> <h2>JSON performance</h2>
<p><button id="reset-all" @onclick=@Reset>Reset</button></p> <p><button id="reset-all" @onclick=Reset>Reset</button></p>
<button id="serialize-small" @onclick=@SerializeSmall>Serialize (small)</button> <button id="serialize-small" @onclick=SerializeSmall>Serialize (small)</button>
<button id="serialize-large" @onclick=@SerializeLarge>Serialize (large)</button> <button id="serialize-large" @onclick=SerializeLarge>Serialize (large)</button>
<p><pre style="border: 1px solid black; overflow: scroll;">@serializedValue</pre></p> <p><pre style="border: 1px solid black; overflow: scroll;">serializedValue</pre></p>
@if (serializedValue != null) @if (serializedValue != null)
{ {
<p>Serialized length: <strong id="serialized-length">@serializedValue.Length</strong> chars</p> <p>Serialized length: <strong id="serialized-length">serializedValue.Length</strong> chars</p>
} }
<button id="deserialize-small" @onclick=@DeserializeSmall>Deserialize (small)</button> <button id="deserialize-small" @onclick=DeserializeSmall>Deserialize (small)</button>
<button id="deserialize-large" @onclick=@DeserializeLarge>Deserialize (large)</button> <button id="deserialize-large" @onclick=DeserializeLarge>Deserialize (large)</button>
@if (numPeopleDeserialized > 0) @if (numPeopleDeserialized > 0)
{ {

View File

@ -3,9 +3,9 @@
<h2>Render List</h2> <h2>Render List</h2>
Number of items: <input id="num-items" type="number" @bind=@numItems /> Number of items: <input id="num-items" type="number" @bind=numItems />
<button id="show-list" @onclick=@Show>Show</button> <button id="show-list" @onclick=Show>Show</button>
<button id="hide-list" @onclick=@Hide>Hide</button> <button id="hide-list" @onclick=Hide>Hide</button>
@if (show) @if (show)
{ {

View File

@ -4,7 +4,7 @@
<p>Current count: @currentCount</p> <p>Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="@IncrementCount">Click me</button> <button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code { @code {
int currentCount = 0; int currentCount = 0;

View File

@ -1,11 +1,11 @@
<div class="top-row pl-4 navbar navbar-dark"> <div class="top-row pl-4 navbar navbar-dark">
<a class="navbar-brand" href="">Blazor app</a> <a class="navbar-brand" href="">Blazor app</a>
<button class="navbar-toggler" @onclick=@ToggleNavMenu> <button class="navbar-toggler" @onclick=ToggleNavMenu>
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
</div> </div>
<div class=@(collapseNavMenu ? "collapse" : null) @onclick=@ToggleNavMenu> <div class=@(collapseNavMenu ? "collapse" : null) @onclick=ToggleNavMenu>
<ul class="nav flex-column"> <ul class="nav flex-column">
<li class="nav-item px-3"> <li class="nav-item px-3">
<NavLink class="nav-link" href="" Match=NavLinkMatch.All> <NavLink class="nav-link" href="" Match=NavLinkMatch.All>

View File

@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Components.Forms
/// Gets or sets the value of the input. This should be used with two-way binding. /// Gets or sets the value of the input. This should be used with two-way binding.
/// </summary> /// </summary>
/// <example> /// <example>
/// @bind-Value="@model.PropertyName" /// @bind-Value="model.PropertyName"
/// </example> /// </example>
[Parameter] public T Value { get; private set; } [Parameter] public T Value { get; private set; }

View File

@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Components.Forms
/* This is exactly equivalent to a .razor file containing: /* This is exactly equivalent to a .razor file containing:
* *
* @inherits InputBase<bool> * @inherits InputBase<bool>
* <input type="checkbox" @bind="@CurrentValue" id="@Id" class="@CssClass" /> * <input type="checkbox" @bind="CurrentValue" id="@Id" class="@CssClass" />
* *
* The only reason it's not implemented as a .razor file is that we don't presently have the ability to compile those * The only reason it's not implemented as a .razor file is that we don't presently have the ability to compile those
* files within this project. Developers building their own input components should use Razor syntax. * files within this project. Developers building their own input components should use Razor syntax.

View File

@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Components.Forms
/* This is almost equivalent to a .razor file containing: /* This is almost equivalent to a .razor file containing:
* *
* @inherits InputBase<string> * @inherits InputBase<string>
* <input @bind="@CurrentValue" id="@Id" class="@CssClass" /> * <input @bind="CurrentValue" id="@Id" class="@CssClass" />
* *
* The only reason it's not implemented as a .razor file is that we don't presently have the ability to compile those * The only reason it's not implemented as a .razor file is that we don't presently have the ability to compile those
* files within this project. Developers building their own input components should use Razor syntax. * files within this project. Developers building their own input components should use Razor syntax.

View File

@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Components.Forms
/* This is almost equivalent to a .razor file containing: /* This is almost equivalent to a .razor file containing:
* *
* @inherits InputBase<string> * @inherits InputBase<string>
* <textarea @bind="@CurrentValue" id="@Id" class="@CssClass"></textarea> * <textarea @bind="CurrentValue" id="@Id" class="@CssClass"></textarea>
* *
* The only reason it's not implemented as a .razor file is that we don't presently have the ability to compile those * The only reason it's not implemented as a .razor file is that we don't presently have the ability to compile those
* files within this project. Developers building their own input components should use Razor syntax. * files within this project. Developers building their own input components should use Razor syntax.

View File

@ -1,7 +1,7 @@
@using System.Collections.Generic @using System.Collections.Generic
Child components follow. Child components follow.
<button class="addChild" @onclick="@AddChild">Add</button> <button class="addChild" @onclick="AddChild">Add</button>
<button class="removeChild" @onclick="@RemoveChild">Remove</button> <button class="removeChild" @onclick="RemoveChild">Remove</button>
@foreach (var message in currentChildrenMessages) @foreach (var message in currentChildrenMessages)
{ {

View File

@ -2,8 +2,8 @@
<div> <div>
<span id="state">@state</span> <span id="state">@state</span>
<button id="tick" @onclick="@Tick">Tick</button> <button id="tick" @onclick="Tick">Tick</button>
<button id="tock" @onclick="@Tock">Tock</button> <button id="tock" @onclick="Tock">Tock</button>
</div> </div>
@code @code

View File

@ -144,7 +144,7 @@
<h2>Select</h2> <h2>Select</h2>
<p> <p>
<select id="select-box" @bind="@selectValue"> <select id="select-box" @bind="selectValue">
<option value=@SelectableValue.First>First choice</option> <option value=@SelectableValue.First>First choice</option>
<option value=@SelectableValue.Second>Second choice</option> <option value=@SelectableValue.Second>Second choice</option>
<option value=@SelectableValue.Third>Third choice</option> <option value=@SelectableValue.Third>Third choice</option>
@ -154,7 +154,7 @@
} }
</select> </select>
<span id="select-box-value">@selectValue</span> <span id="select-box-value">@selectValue</span>
<button id="select-box-add-option" @onclick="@AddAndSelectNewSelectOption">Add and select new item</button> <button id="select-box-add-option" @onclick="AddAndSelectNewSelectOption">Add and select new item</button>
</p> </p>
@code { @code {

View File

@ -13,7 +13,7 @@
<strong id="receive-by-interface-num-renders">@numRenders</strong> <strong id="receive-by-interface-num-renders">@numRenders</strong>
@* Prevent rerendering this component when the button is clicked. *@ @* Prevent rerendering this component when the button is clicked. *@
<button id="decrement-count" @onclick=@Ancestor.DecrementCount>Decrement</button> <button id="decrement-count" @onclick=Ancestor.DecrementCount>Decrement</button>
</p> </p>
@code { @code {

View File

@ -17,7 +17,7 @@
<fieldset> <fieldset>
<legend>External controls</legend> <legend>External controls</legend>
<button id="reset-child" @onclick="@ResetChildCounter">Reset</button> <button id="reset-child" @onclick="ResetChildCounter">Reset</button>
<label> <label>
<input id="toggle-child" type="checkbox" @bind="_toggleCapturedComponentPresence" /> <input id="toggle-child" type="checkbox" @bind="_toggleCapturedComponentPresence" />
Toggle counter presence Toggle counter presence

View File

@ -1,9 +1,9 @@
<h1>Counter</h1> <h1>Counter</h1>
<p>Current count: @currentCount</p> <p>Current count: @currentCount</p>
<p><button @onclick="@((handleClicks ? (Action)IncrementCount : null))">Click me</button></p> <p><button @onclick="@(handleClicks ? (Action)IncrementCount : null)">Click me</button></p>
<label> <label>
<input type="checkbox" @bind="@handleClicks" /> <input type="checkbox" @bind="handleClicks" />
Toggle click handler registration Toggle click handler registration
</label> </label>

View File

@ -3,7 +3,7 @@
<!-- Note: passing 'Message' parameter with lowercase name to show it's case insensitive --> <!-- Note: passing 'Message' parameter with lowercase name to show it's case insensitive -->
<p>Current count: <MessageComponent message=@currentCount.ToString() /></p> <p>Current count: <MessageComponent message=@currentCount.ToString() /></p>
<button @onclick="@IncrementCount">Click me</button> <button @onclick="IncrementCount">Click me</button>
@code { @code {
int currentCount = 0; int currentCount = 0;

View File

@ -10,10 +10,10 @@
Result: <strong id="result">@result</strong> Result: <strong id="result">@result</strong>
</p> </p>
<button id="run-without-dispatch" @onclick=@RunWithoutDispatch>Run without dispatch</button> <button id="run-without-dispatch" @onclick=RunWithoutDispatch>Run without dispatch</button>
<button id="run-with-dispatch" @onclick=@RunWithDispatch>Run with dispatch</button> <button id="run-with-dispatch" @onclick=RunWithDispatch>Run with dispatch</button>
<button id="run-with-double-dispatch" @onclick=@RunWithDoubleDispatch>Run with double dispatch</button> <button id="run-with-double-dispatch" @onclick=RunWithDoubleDispatch>Run with double dispatch</button>
<button id="run-async-with-dispatch" @onclick=@RunAsyncWorkWithDispatch>Run async work with dispatch</button> <button id="run-async-with-dispatch" @onclick=RunAsyncWorkWithDispatch>Run async work with dispatch</button>
@code { @code {
string result; string result;

View File

@ -19,7 +19,7 @@
{ {
<input id="capturedElement" @ref="_myInput" /> <input id="capturedElement" @ref="_myInput" />
} }
<button @onclick="@MakeInteropCall">Click me</button> <button @onclick="MakeInteropCall">Click me</button>
<label> <label>
<input type="checkbox" @bind="_toggleCapturedElementPresence" /> <input type="checkbox" @bind="_toggleCapturedElementPresence" />
Toggle input Toggle input

View File

@ -22,7 +22,7 @@
<h3>Event log</h3> <h3>Event log</h3>
<textarea readonly @bind="@logValue"></textarea> <textarea readonly @bind="logValue"></textarea>
@code { @code {
string logValue = string.Empty; string logValue = string.Empty;

View File

@ -1,5 +1,5 @@
<button @onclick="@OnClick">@Text</button> <button @onclick="OnClick">@Text</button>
@code { @code {
[Parameter] int Count { get; set; } [Parameter] int Count { get; set; }

View File

@ -1,5 +1,5 @@
<button @onclick="@OnClick">@Text</button> <button @onclick="OnClick">@Text</button>
@code { @code {
[Parameter] EventCallback OnClick { get; set; } [Parameter] EventCallback OnClick { get; set; }

View File

@ -1,5 +1,5 @@
<button @onclick="@OnClick">@Text</button> <button @onclick="OnClick">@Text</button>
@code { @code {
[Parameter] EventCallback<UIMouseEventArgs> OnClick { get; set; } [Parameter] EventCallback<UIMouseEventArgs> OnClick { get; set; }

View File

@ -14,13 +14,13 @@
<h2>Form with onsubmit handler</h2> <h2>Form with onsubmit handler</h2>
<form action="about:blank" @onsubmit=@(() => { })> <form action="about:blank" @onsubmit=@(() => { })>
<button id="form-1-button" @onclick=@HandleClick>Click me</button> <button id="form-1-button" @onclick=HandleClick>Click me</button>
</form> </form>
<h2>Form without onsubmit handler</h2> <h2>Form without onsubmit handler</h2>
<form action="about:blank"> <form action="about:blank">
<button id="form-2-button" @onclick=@HandleClick>Click me</button> <button id="form-2-button" @onclick=HandleClick>Click me</button>
</form> </form>
@if (didHandleEvent) @if (didHandleEvent)

View File

@ -13,7 +13,7 @@
<p>Click the following button to invoke a JavaScript function.</p> <p>Click the following button to invoke a JavaScript function.</p>
<button @onclick="@ShowJavaScriptPrompt">Show JavaScript prompt</button> <button @onclick="ShowJavaScriptPrompt">Show JavaScript prompt</button>
@if (!string.IsNullOrEmpty(result)) @if (!string.IsNullOrEmpty(result))
{ {

View File

@ -2,14 +2,14 @@
<h2>Focus and activation</h2> <h2>Focus and activation</h2>
<p @onfocusin="@OnFocusIn" @onfocusout="@OnFocusOut"> <p @onfocusin="OnFocusIn" @onfocusout="OnFocusOut">
Input: <input id="input" type="text" @onfocus="@OnFocus" @onblur="@OnBlur"/> Input: <input id="input" type="text" @onfocus="OnFocus" @onblur="OnBlur"/>
</p> </p>
<p> <p>
Output: <span id="output">@message</span> Output: <span id="output">@message</span>
</p> </p>
<p> <p>
<button @onclick="@Clear">Clear</button> <button @onclick="Clear">Clear</button>
</p> </p>
<p> <p>

View File

@ -15,14 +15,14 @@
cascade an EditContext to the components that integrate with it. cascade an EditContext to the components that integrate with it.
</p> </p>
<form @onsubmit="@HandleSubmit"> <form @onsubmit="HandleSubmit">
<p class="user-name"> <p class="user-name">
User name: User name:
<input @bind="@person.UserName" class="@editContext.FieldClass(() => person.UserName)" /> <input @bind="person.UserName" class="@editContext.FieldClass(() => person.UserName)" />
</p> </p>
<p class="accepts-terms"> <p class="accepts-terms">
Accept terms: Accept terms:
<input type="checkbox" @bind="@person.AcceptsTerms" class="@editContext.FieldClass(() => person.AcceptsTerms)" /> <input type="checkbox" @bind="person.AcceptsTerms" class="@editContext.FieldClass(() => person.AcceptsTerms)" />
</p> </p>
<button type="submit">Submit</button> <button type="submit">Submit</button>

View File

@ -5,10 +5,10 @@
<DataAnnotationsValidator /> <DataAnnotationsValidator />
<p class="user-name"> <p class="user-name">
User name: <input @bind="@UserName" class="@context.FieldClass(() => UserName)" /> User name: <input @bind="UserName" class="@context.FieldClass(() => UserName)" />
</p> </p>
<p class="accepts-terms"> <p class="accepts-terms">
Accept terms: <input type="checkbox" @bind="@AcceptsTerms" class="@context.FieldClass(() => AcceptsTerms)" /> Accept terms: <input type="checkbox" @bind="AcceptsTerms" class="@context.FieldClass(() => AcceptsTerms)" />
</p> </p>
<button type="submit">Submit</button> <button type="submit">Submit</button>

View File

@ -5,30 +5,30 @@
<DataAnnotationsValidator /> <DataAnnotationsValidator />
<p class="name"> <p class="name">
Name: <InputText @bind-Value="@person.Name" placeholder="Enter your name" /> Name: <InputText @bind-Value="person.Name" placeholder="Enter your name" />
</p> </p>
<p class="email"> <p class="email">
Email: <InputText @bind-Value="@person.Email" /> Email: <InputText @bind-Value="person.Email" />
<ValidationMessage For="@(() => person.Email)" /> <ValidationMessage For="@(() => person.Email)" />
</p> </p>
<p class="age"> <p class="age">
Age (years): <InputNumber @bind-Value="@person.AgeInYears" placeholder="Enter your age" /> Age (years): <InputNumber @bind-Value="person.AgeInYears" placeholder="Enter your age" />
</p> </p>
<p class="height"> <p class="height">
Height (optional): <InputNumber @bind-Value="@person.OptionalHeight" /> Height (optional): <InputNumber @bind-Value="person.OptionalHeight" />
</p> </p>
<p class="description"> <p class="description">
Description: <InputTextArea @bind-Value="@person.Description" placeholder="Tell us about yourself" /> Description: <InputTextArea @bind-Value="person.Description" placeholder="Tell us about yourself" />
</p> </p>
<p class="renewal-date"> <p class="renewal-date">
Renewal date: <InputDate @bind-Value="@person.RenewalDate" placeholder="Enter the date" /> Renewal date: <InputDate @bind-Value="person.RenewalDate" placeholder="Enter the date" />
</p> </p>
<p class="expiry-date"> <p class="expiry-date">
Expiry date (optional): <InputDate @bind-Value="@person.OptionalExpiryDate" /> Expiry date (optional): <InputDate @bind-Value="person.OptionalExpiryDate" />
</p> </p>
<p class="ticket-class"> <p class="ticket-class">
Ticket class: Ticket class:
<InputSelect @bind-Value="@person.TicketClass" size="4"> <InputSelect @bind-Value="person.TicketClass" size="4">
<option>(select)</option> <option>(select)</option>
<option value="@TicketClass.Economy">Economy class</option> <option value="@TicketClass.Economy">Economy class</option>
<option value="@TicketClass.Premium">Premium class</option> <option value="@TicketClass.Premium">Premium class</option>
@ -37,10 +37,10 @@
<span id="selected-ticket-class">@person.TicketClass</span> <span id="selected-ticket-class">@person.TicketClass</span>
</p> </p>
<p class="accepts-terms"> <p class="accepts-terms">
Accepts terms: <InputCheckbox @bind-Value="@person.AcceptsTerms" title="You have to check this" /> Accepts terms: <InputCheckbox @bind-Value="person.AcceptsTerms" title="You have to check this" />
</p> </p>
<p class="is-evil"> <p class="is-evil">
Is evil: <InputCheckbox @bind-Value="@person.IsEvil" /> Is evil: <InputCheckbox @bind-Value="person.IsEvil" />
</p> </p>
<button type="submit">Submit</button> <button type="submit">Submit</button>

View File

@ -6,10 +6,10 @@
<p> <p>
<div>URI:</div> <div>URI:</div>
<input id="request-uri" @bind="@uri" size="60"/> <input id="request-uri" @bind="uri" size="60"/>
</p> </p>
<button id="send-request" @onclick="@DoRequest">Request</button> <button id="send-request" @onclick="DoRequest">Request</button>
@if (responseStatusCode.HasValue) @if (responseStatusCode.HasValue)
{ {

View File

@ -2,9 +2,9 @@
<h1>Cookie counter</h1> <h1>Cookie counter</h1>
<p>The server increments the count by one on each request.</p> <p>The server increments the count by one on each request.</p>
<p>TestServer base URL: <input @bind="@testServerBaseUrl" /></p> <p>TestServer base URL: <input @bind="testServerBaseUrl" /></p>
<button id="delete" @onclick="@DeleteCookie">Delete cookie</button> <button id="delete" @onclick="DeleteCookie">Delete cookie</button>
<button id="increment" @onclick="@GetAndIncrementCounter">Get and increment current value</button> <button id="increment" @onclick="GetAndIncrementCounter">Get and increment current value</button>
@if (!requestInProgress) @if (!requestInProgress)
{ {

View File

@ -7,12 +7,12 @@
<p> <p>
<div>URI:</div> <div>URI:</div>
<input id="request-uri" @bind="@uri" size="60"/> <input id="request-uri" @bind="uri" size="60"/>
</p> </p>
<p> <p>
<div>Method:</div> <div>Method:</div>
<select id="request-method" @bind="@method"> <select id="request-method" @bind="method">
<option value="GET">GET</option> <option value="GET">GET</option>
<option value="POST">POST</option> <option value="POST">POST</option>
<option value="PUT">PUT</option> <option value="PUT">PUT</option>
@ -22,7 +22,7 @@
<p> <p>
<div>Request body:</div> <div>Request body:</div>
<textarea id="request-body" @bind="@requestBody"></textarea> <textarea id="request-body" @bind="requestBody"></textarea>
</p> </p>
<p> <p>
@ -30,20 +30,20 @@
@foreach (var header in requestHeaders) @foreach (var header in requestHeaders)
{ {
<div class="header-entry"> <div class="header-entry">
Name: <input @bind="@header.Name" /> Name: <input @bind="header.Name" />
Value: <input @bind="@header.Value" /> Value: <input @bind="header.Value" />
[<a href="#" @onclick="@(e => RemoveHeader(header))">remove</a>] [<a href="#" @onclick="@(e => RemoveHeader(header))">remove</a>]
</div> </div>
} }
<button id="add-header" @onclick="@AddHeader">Add</button> <button id="add-header" @onclick="AddHeader">Add</button>
</p> </p>
<p> <p>
<div>Request referrer:</div> <div>Request referrer:</div>
<input id="request-referrer" type="text" @bind=@requestReferrer /> <input id="request-referrer" type="text" @bind=requestReferrer />
</p> </p>
<button id="send-request" @onclick="@DoRequest">Request</button> <button id="send-request" @onclick="DoRequest">Request</button>
@if (responseStatusCode.HasValue) @if (responseStatusCode.HasValue)
{ {

View File

@ -1,7 +1,7 @@
@using Microsoft.AspNetCore.Components.RenderTree @using Microsoft.AspNetCore.Components.RenderTree
<div id="test-selector"> <div id="test-selector">
Select test: Select test:
<select @bind=@SelectedComponentTypeName> <select @bind=SelectedComponentTypeName>
<option value="none">Choose...</option> <option value="none">Choose...</option>
<option value="BasicTestApp.InteropComponent">Interop component</option> <option value="BasicTestApp.InteropComponent">Interop component</option>
<option value="BasicTestApp.AsyncEventHandlerComponent">Async event handlers</option> <option value="BasicTestApp.AsyncEventHandlerComponent">Async event handlers</option>

View File

@ -1,4 +1,4 @@
<input @bind-value=@inputText @bind-value:event="oninput" /> <input @bind-value=inputText @bind-value:event="oninput" />
<p>The text below should update automatically as you type in the text field above</p> <p>The text below should update automatically as you type in the text field above</p>

View File

@ -4,7 +4,7 @@
@using System.Text.Json @using System.Text.Json
@inject IJSRuntime JSRuntime @inject IJSRuntime JSRuntime
<button id="btn-interop" @onclick="@InvokeInteropAsync">Invoke interop!</button> <button id="btn-interop" @onclick="InvokeInteropAsync">Invoke interop!</button>
<div> <div>
<h1>Invocations</h1> <h1>Invocations</h1>

View File

@ -2,8 +2,8 @@
<div class="key-cases"> <div class="key-cases">
<div class="model"> <div class="model">
<p>Model</p> <p>Model</p>
<textarea @bind="@modelJson" id="key-model"></textarea> <textarea @bind="modelJson" id="key-model"></textarea>
<button @onclick="@Update">Update</button> <button @onclick="Update">Update</button>
</div> </div>
<div class="render-output"> <div class="render-output">
<p>Output</p> <p>Output</p>

View File

@ -1,6 +1,6 @@
@using System.Text.Json @using System.Text.Json
Type here: <input @onkeypress=@OnKeyPressed /> Type here: <input @onkeypress=OnKeyPressed />
<ul> <ul>
@foreach (var key in keysPressed) @foreach (var key in keysPressed)
{ {

View File

@ -7,23 +7,23 @@
Output: <span id="output">@message</span> Output: <span id="output">@message</span>
</p> </p>
<p> <p>
Mouseover: <input id="mouseover_input" type="text" @onmouseover="@OnMouseOver" @onmouseout="@OnMouseOut" /> Mouseover: <input id="mouseover_input" type="text" @onmouseover="OnMouseOver" @onmouseout="OnMouseOut" />
</p> </p>
<p> <p>
<span id="mousemove_input" @onmousemove="@OnMouseMove">Mousemove city!</span> <span id="mousemove_input" @onmousemove="OnMouseMove">Mousemove city!</span>
</p> </p>
<p> <p>
Mousedown: <input id="mousedown_input" @onmousedown="@OnMouseDown" @onmouseup="@OnMouseUp" /> Mousedown: <input id="mousedown_input" @onmousedown="OnMouseDown" @onmouseup="OnMouseUp" />
</p> </p>
<p> <p>
Pointerdown: <input id="pointerdown_input" @onpointerdown="@OnPointerDown" /> Pointerdown: <input id="pointerdown_input" @onpointerdown="OnPointerDown" />
</p> </p>
<p> <p>
<div id="drag_input" draggable="true" @ondragstart="@OnDragStart">Drag Me</div> <div id="drag_input" draggable="true" @ondragstart="OnDragStart">Drag Me</div>
<div id="drop" @ondrop="@OnDrop" ondragover="event.preventDefault()" style="width: 100px; height: 100px; border: dotted">Drop Target</div> <div id="drop" @ondrop="OnDrop" ondragover="event.preventDefault()" style="width: 100px; height: 100px; border: dotted">Drop Target</div>
</p> </p>
<p> <p>
<button @onclick="@Clear">Clear</button> <button @onclick="Clear">Clear</button>
</p> </p>
<p> <p>

View File

@ -12,8 +12,8 @@
@foreach (var item in todoItems.Where(item => !item.IsDone)) @foreach (var item in todoItems.Where(item => !item.IsDone))
{ {
<li @key="@item.Id" class="@($"item-{item.Id}")"> <li @key="@item.Id" class="@($"item-{item.Id}")">
<input type="checkbox" @bind="@item.IsDone"/> <input type="checkbox" @bind="item.IsDone"/>
<input type="text" @bind="@item.Text" @oninput="@Shuffle" /> <input type="text" @bind="item.Text" @oninput="Shuffle" />
</li> </li>
} }
</ul> </ul>
@ -24,8 +24,8 @@
@foreach (var item in todoItems.Where(item => item.IsDone)) @foreach (var item in todoItems.Where(item => item.IsDone))
{ {
<li @key="@item.Id" class="@($"item-{item.Id}")"> <li @key="@item.Id" class="@($"item-{item.Id}")">
<input type="checkbox" @bind="@item.IsDone" /> <input type="checkbox" @bind="item.IsDone" />
<input type="text" @bind="@item.Text" @oninput="@Shuffle" /> <input type="text" @bind="item.Text" @oninput="Shuffle" />
</li> </li>
} }
</ul> </ul>

View File

@ -1,7 +1,7 @@
@inject IUriHelper UriHelper @inject IUriHelper UriHelper
@inject Microsoft.JSInterop.IJSRuntime JSRuntime @inject Microsoft.JSInterop.IJSRuntime JSRuntime
<button @onclick="@Navigate">Navigate</button> <button @onclick="Navigate">Navigate</button>
<span id="test-info">@UrlLocation</span> <span id="test-info">@UrlLocation</span>

View File

@ -7,17 +7,17 @@
Output: <span id="output">@message</span> Output: <span id="output">@message</span>
</p> </p>
<p> <p>
<button @ontouchstart=@OnTouch <button @ontouchstart=OnTouch
@ontouchcancel=@OnTouch @ontouchcancel=OnTouch
@ontouchenter=@OnTouch @ontouchenter=OnTouch
@ontouchleave=@OnTouch @ontouchleave=OnTouch
@ontouchend=@OnTouch @ontouchend=OnTouch
@ontouchmove=@OnTouch> @ontouchmove=OnTouch>
TOUCH ME TOUCH ME
</button> </button>
</p> </p>
<p> <p>
<button @onclick="@Clear">Clear</button> <button @onclick="Clear">Clear</button>
</p> </p>
</div> </div>

View File

@ -4,7 +4,7 @@
<p>Current count: @currentCount</p> <p>Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="@IncrementCount" id="thecounter">Click me</button> <button class="btn btn-primary" @onclick="IncrementCount" id="thecounter">Click me</button>
@code { @code {
int currentCount = 0; int currentCount = 0;

View File

@ -7,7 +7,7 @@
} }
else else
{ {
<button id="cause-error" @onclick="@CauseError">Cause error</button> <button id="cause-error" @onclick="CauseError">Cause error</button>
} }
@code { @code {
public bool ShouldCauseError { get; set; } public bool ShouldCauseError { get; set; }

View File

@ -1,11 +1,11 @@
<div class="top-row pl-4 navbar navbar-dark"> <div class="top-row pl-4 navbar navbar-dark">
<a class="navbar-brand" href="">Razor Components</a> <a class="navbar-brand" href="">Razor Components</a>
<button class="navbar-toggler" @onclick=@ToggleNavMenu> <button class="navbar-toggler" @onclick=ToggleNavMenu>
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
</div> </div>
<div class=@(collapseNavMenu ? "collapse" : null) @onclick=@ToggleNavMenu> <div class=@(collapseNavMenu ? "collapse" : null) @onclick=ToggleNavMenu>
<ul class="nav flex-column"> <ul class="nav flex-column">
<li class="nav-item px-3"> <li class="nav-item px-3">
<NavLink class="nav-link" href="" Match=NavLinkMatch.All> <NavLink class="nav-link" href="" Match=NavLinkMatch.All>

View File

@ -1,7 +1,7 @@
<div class="special-style"> <div class="special-style">
This component, including the CSS and image required to produce its This component, including the CSS and image required to produce its
elegant styling, is in an external NuGet package. elegant styling, is in an external NuGet package.
<button @onclick="@ChangeLabel">@buttonLabel </button> <button @onclick="ChangeLabel">@buttonLabel </button>
</div> </div>
@code { @code {