javascript - 如何在按钮的禁用属性中添加多个条件
问题描述
我想根据两个条件禁用我的按钮。
- 表格无效
- 什么时候
authenticationType
是真的
我尝试了很多类似下面的东西。
[disabled]="!userForm.form.valid && authenticationType" <br>
[disabled]="(!userForm.form.valid===true && authenticationType===true) ? true : false"
但对我没有用。请帮忙
解决方案
[禁用]="!userForm.form.valid || authenticationType"
推荐阅读
- java - 无法在 onSuccess 和 onFailure 处 @Override
- java - 在 Java 中将字符串元素添加到整数列表中
- reactjs - prop-types oneOf 允许所有字符串
- svg - svgr 未知的命令行选项:azure devops 管道中的“--ext”
- elixir - 如何从主管同时生成多个进程?
- tensorflow - 如何解析张量流事件文件?
- mysql - 我的案例总和似乎重复了两次
- amazon-web-services - AWS s3 跨账户网站 AccessDenied
- loops - 如何在 Kotlin 中循环播放按钮的动画?
- php - PHP isset GET中的唯一标识符链接值接收失败