html - TS2322:类型“自动”不能分配给类型“方向”
问题描述
当我dir="auto"
在 Angular 10 项目的 html 文件中使用时。
<span dir="auto">
当我启用时(特别是启用时)运行ng build
时,出现错误strictTemplates
strictAttributeTypes
TS2322: Type '"auto"' is not assignable to type 'Direction'
//tsconfig.json
{
"compilerOptions":{...},
"angularCompilerOptions": {
"strictTemplates": true, //<--- this
"enableIvy": true
}
}
在 HTML5 规范中,“auto”对dir
属性有效。
打字稿版本:4.0.2
解决方案
推荐阅读
- web - 我对苹果主页很好奇
- hadoop - 如何在没有 hadoop 的情况下安装 pyspark?
- c# - What would be the best option to display class properties in a Microsoft.Toolkit.Uwp.UI.Controls.DataGrid?
- android - 在 Google Play 商店发布后,新创建的应用程序无法运行
- javascript - JavaScript 以一种聪明的方式创建带有子数组的对象/数组/在 JavaScript 中复制 PHP 数据结构
- python - left 删除字符串中第二个数字之前的任何内容
- r - 在折线图的特定位置添加点或点,并使用 ggplotly() 相应地调整工具提示
- docker - Docker 容器中的 Headless Cypress 分辨率始终为 1280x1024
- linux - 在 bash 脚本中添加请求的参数作为变量
- python - 安装 Jupyter Notebooks - Python 3.9 - Windows 10 的问题