单选框根据点击来渲染或者隐藏时间框
作者:互联网
<div class="layui-form-item">
<label class="layui-form-label"><span
style='color: red; font-weight: bold'>*</span> 开放时间</label>
<div class="layui-input-block" style="width: 300px">
<input type="radio" name="openTime" value="0" lay-filter="testRadio" title="长期有效" checked>
<input type="radio" name="openTime" value="1" lay-filter="testRadio" title="截止至">
<input type="text" class="layui-input" id="op" name="op" style="display:none"
value="{{\Carbon\Carbon::now()->format('Y-m-d')}}">
</div>
</div>
//单选
form.on('radio(testRadio)', function (data) {
console.log(data);
if (data.value === '1') {
$("#op").css("display", "block");
} else {
$("#op").css("display", "none");
}
});
标签:渲染,单选框,点击,nbsp,Carbon,data,display,css,op 来源: https://blog.csdn.net/weixin_46277258/article/details/123246402