我已经使用create-react-native-app
创建了应用程序。我用来运行和进行生产构建的命令是:
"scripts": {
"web": "react-scripts start",
"build": "react-scripts build"
}
对于react native,我可以使用react-native-scripts-ts
,但是如何使用react-native-web配置Typescript管道?
答案 0 :(得分:0)
因此解决方案是使用:
@page
@model Test.Pages.UserRoles.IndexModel
@{
ViewData["Title"] = "Index";
}
<h2>Index</h2>
<p>
<a asp-page="Create">Create New</a>
</p>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.UserRole[0].Role)
</th>
<th>
@Html.DisplayNameFor(model => model.UserRole[0].User)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.UserRole)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Role.RoleId)
</td>
<td>
@Html.DisplayFor(modelItem => item.User.UserName)
</td>
<td>
<a asp-page="./Edit" asp-route-id="@item.Id">Edit</a> |
<a asp-page="./Details" asp-route-id="@item.Id">Details</a> |
<a asp-page="./Delete" asp-route-id="@item.Id">Delete</a>
</td>
</tr>
}
</tbody>
</table>
并使用以下命令运行"scripts": {
"test": "jest",
"web": "react-scripts-ts start",
"build": "react-native-scripts-ts build",
"test:web": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
:
App.tsx