我是打字稿的新手,并试图在我遇到这个问题的地方进行处理,我使用.ts扩展名保存了一个文件,而不是将文件识别为打字稿文件,系统将其识别为传输流文件。我已经使用 node.js 安装了所有打字稿文件。每当我尝试编译代码时,显示的错误如下:
PS D:\WorkSpace\typescript> tsc basics.ts tsc :无法加载文件 C:\Users\mn\AppData\Roaming\npm\tsc.ps1,因为在此系统上禁用了运行脚本。有关详细信息,请参阅 https://go.microsoft.com/fwlink/?LinkID=135170 上的 about_Execution_Policies。
在行:1 字符:1
- tsc基础知识.ts
Run Code Online (Sandbox Code Playgroud)+ CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
这是文件在文件夹中的显示方式:
正如下面的 GIF 所示,TextFormField我正在使用的是向后输入值。我也将TextDirection属性设置为ltr,但它没有改变任何东西。其他TextFormFields似乎没有这个问题。输入的文本被发送回另一个屏幕Navigator.pop,并以相同的向后有人发送。
导致问题的 textFormField 代码:
TextFormField(
// validator: (String value) {
// return value.isEmpty ? "task must have a name" : null;
// },
textDirection: TextDirection.ltr,
maxLength: 100,
controller: newcontroller, // Just an ordinary TextController
onChanged: (value) {
setState(() {
newcontroller.text = value;
});
},
decoration: InputDecoration(
errorText: _validate // Just a boolean value set to false by default
? 'Value Can\'t Be Empty' : null,
labelText: "name …Run Code Online (Sandbox Code Playgroud)