The root cause here was that we weren't setting the language version in
MSBuild, which is only for the command line version.
(cherry picked from commit 319e31f71a
)
This commit is contained in:
Родитель
b4d3d2e964
Коммит
754576946d
|
@ -14,6 +14,8 @@
|
|||
<!-- Deactivates the Razor SDK's build-time compilation. We do our own -->
|
||||
<RazorCompileOnBuild>false</RazorCompileOnBuild>
|
||||
|
||||
<RazorLangVersion>Experimental</RazorLangVersion>
|
||||
|
||||
<!--
|
||||
This version is used to build our RazorConfiguration, and is hardcoded into the tools in VS. If you change
|
||||
This to a value that doesn't match VS, then the Blazor Razor experience won't work for those documents.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
@ -40,6 +40,17 @@ namespace Microsoft.AspNetCore.Blazor.E2ETest.Tests
|
|||
Assert.Equal("Hello from TextOnlyComponent", appElement.Text);
|
||||
}
|
||||
|
||||
// This verifies that we've correctly configured the Razor language version via MSBuild.
|
||||
// See #974
|
||||
[Fact]
|
||||
public void CanRenderComponentWithDataDash()
|
||||
{
|
||||
var appElement = MountTestComponent<DataDashComponent>();
|
||||
var element = appElement.FindElement(By.Id("cool_beans"));
|
||||
Assert.Equal("17", element.GetAttribute("data-tab"));
|
||||
Assert.Equal("17", element.Text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanRenderComponentWithAttributes()
|
||||
{
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<div id="cool_beans" data-tab="@TabId">@TabId</div>
|
||||
|
||||
@functions {
|
||||
string TabId = "17";
|
||||
}
|
Загрузка…
Ссылка в новой задаче