想要达到的目的:判断内容全为空格时,禁止按钮使用。全部输入空格提示另一种方法:Ts:pattern:any={space:'(^1+$)'};template:......判断条件如下:(问题出在后半部分,即判断内容是否全部为空格,(this.EvaluateInfo.content.replace('\s+','').length>0))privateEvaluatEInfo={content:''}[disabled]="publishctrl"//控制按钮是否可用if(this.EvaluateInfo.content.length>0){this.publishctrl=false;}elseif((this.EvaluateInfo.content.length0)){this.publishctrl=true;}\s↩
添加回答
举报
0/150
提交
取消