-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Razor Components: Get started topic update (#10780)
* Razor Components: Get started topic update Updates * React to feedback * Apply suggestions from code review So much for colloquial style. 😄 lol (See what I have to go thru here, Dan. lol) Co-Authored-By: guardrex <1622880+guardrex@users.noreply.github.com>
- Loading branch information
1 parent
3fad409
commit fb7517d
Showing
7 changed files
with
214 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
aspnetcore/razor-components/get-started/samples_snapshot/3.x/Counter1.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@page "/counter" | ||
|
||
<h1>Counter</h1> | ||
|
||
<p>Current count: @currentCount</p> | ||
|
||
<button class="btn btn-primary" onclick="@IncrementCount">Click me</button> | ||
|
||
@functions { | ||
int currentCount = 0; | ||
|
||
void IncrementCount() | ||
{ | ||
currentCount++; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
aspnetcore/razor-components/get-started/samples_snapshot/3.x/Counter2.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@functions { | ||
int currentCount = 0; | ||
|
||
[Parameter] int IncrementAmount { get; set; } = 1; | ||
|
||
void IncrementCount() | ||
{ | ||
currentCount += IncrementAmount; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
aspnetcore/razor-components/get-started/samples_snapshot/3.x/Index1.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@page "/" | ||
|
||
<h1>Hello, world!</h1> | ||
|
||
Welcome to your new app. | ||
|
||
<Counter /> |
1 change: 1 addition & 0 deletions
1
aspnetcore/razor-components/get-started/samples_snapshot/3.x/Index2.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<Counter IncrementAmount="10" /> |
36 changes: 36 additions & 0 deletions
36
aspnetcore/razor-components/get-started/samples_snapshot/3.x/launch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": ".NET Core Launch (web)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
"program": "${workspaceFolder}/WebApplication1.Server/bin/Debug/netcoreapp3.0/WebApplication1.Server.dll", | ||
"args": [], | ||
"cwd": "${workspaceFolder}/WebApplication1.Server", | ||
"stopAtEntry": false, | ||
"internalConsoleOptions": "openOnSessionStart", | ||
"launchBrowser": { | ||
"enabled": true, | ||
"args": "${auto-detect-url}", | ||
"windows": { | ||
"command": "cmd.exe", | ||
"args": "/C start ${auto-detect-url}" | ||
}, | ||
"osx": { | ||
"command": "open" | ||
}, | ||
"linux": { | ||
"command": "xdg-open" | ||
} | ||
}, | ||
"env": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"sourceFileMap": { | ||
"/Views": "${workspaceFolder}/Views" | ||
} | ||
} | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
aspnetcore/razor-components/get-started/samples_snapshot/3.x/tasks.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"WebApplication1.Server/WebApplication1.Server.csproj" | ||
], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |