HTML根据条件判断使用哪个class-name

在v-for循环语句中,想根据后端传来的list的某个值来指定不同的class

:class="{'fd-step-blue':item.zt == 1,
'fd-step-green':item.zt==2,
'fd-step-red':item.zt==3,
'fd-step-grey':item.zt==0,
'fd-step':index != dzsjdclcList.length-1,
'fd-step-last':index == dzsjdclcList.length-1}"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
新手资源,可以学习一下html, <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link href="../css/mainpage.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" type="text/css" href="../css/tabs.css" /> <title>注册页面</title> <style type="text/css"> .STYLE5 {font-size: 36px} </style> </head> <body>     [removed] //sNameCheck() && passCheck() && bdaycheck() function validateform(){ if(sNameCheck() && passCheck()&&bdaycheck;()) return true; else return false; } // Login Name Validation function sNameCheck(){ var strName = document.userfrm.sname.value; if(strName.length != 0) { return true; } else { alert("请输入用户名"); return false; } } function passCheck(){ var userpass = document.userfrm.pass.value; var ruserpass = document.userfrm.rpass.value; if(userpass == "" && ruserpass == ""){ alert("未输入密码 \n" + "请输入密码"); document.userfrm.pass.focus(); return false; } if(userpass.length < 6){ alert("密码必须多于或等于 6 个字符。\n"); document.userfrm.pass.focus(); return false; } else if(userpass != ruserpass){ alert("两次输入的密码不一致"); document.userfrm.rpass.select(); return false; } return true; } function bdaycheck(){ var bmonth = document.userfrm.bmon.value; var bday = document.userfrm.bday.value; var byear = document.userfrm.byear.value; if (bmonth == "" || bday == "" || byear == "" || bday == "dd" || byear == "yyyy") { alert("请输入您的生日"); document.userfrm.bmon.focus(); return false; } for (i = 0; i < bday.length; i++) { var bnum = bday.substring(i,i+1) if (!(bnum 0)) { alert("日期无效"); document.userfrm.bday.focus(); return false; } } if(byear.substring(0,1)==2&&byear;.substring(1,2)==0) //年份必须以20打头 { for (j = 2; j < byear.length; j++) { var bynum = byear.substring(j,j+1); if (!(bynum 0)) { alert("年份无效"); document.userfrm.byear.focus(); return false; } } } else { alert("年份必须以20打头"); return false; } if (byear 2120) { alert("您输入的出生年份超出范围!\n请重新输入!"); document.userfrm.byear.focus(); return(false); } else if (bmonth 12) { alert("您输入的月份超出范围!\n请重新输入!"); document.userfrm.bmon.focus(); return(false); } else if (bday 31) { alert("您输入的日期超出范围!\n请重新输入!"); return(false); } return true; } [removed] <form name="userfrm" method="post" action="register_success.htm" validateform( )"> 登录名: <input name="sname" type="text" class="register_textBroader" id="sname" size="24">(可包含 a-z、0-9 和下划线) 密码: <input name="pass" type="password" class="register_textBroader" id="pass" size="26"> (至少包含 6 个字符) 再次输入密码: <input name="rpass" type="password" class="register_textBroader" id="rpass" size="26"></td> 出生日期: <input name="byear" class="register_textBroader" id="byear" value="yyyy" size=4 maxlength=4 > 年   [选择月份] 一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月  月   <input name="bday" class="register_textBroader" id="bday" value="dd" size=2 maxlength=2 >日 <input type="reset" name="Reset" value=" 重 填 "></td> <input type="submit" name="Button" value="同意以下服务条款,提交注册信息"></td> </form> </body> </html>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值