升级layui最新版后,dropdown调整 data.title 属性对 HTML 的转义处理所产生的问题修复。

This commit is contained in:
HDM58\hdm58 2023-09-05 11:35:18 +08:00
parent 574d778598
commit 699430f7b5
2 changed files with 44 additions and 16 deletions

View File

@ -135,17 +135,17 @@ user-select: none;}
<td>\
<input id="start_time_a" name="start_time_a" style="width:120px; display:inline-block;" autocomplete="off" class="layui-input" value="'+detail.start_time_a+'" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间"><div style="display: inline-block; margin-left:3px; width: 86px;"><select lay-filter="start_time_b" id="start_time_b"></select></div><input id="end_time_a" name="end_time_a" style="width:120px; display:inline-block;" autocomplete="off" class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间"><div style="display: inline-block; margin-left:3px; width: 86px;"><select lay-filter="end_time_b" id="end_time_b"></select></div>\
</td>\
<td class="layui-td-gray">提醒<font>*</font></td>\
<td class="layui-td-gray">优先级<font>*</font></td>\
<td>\
<div class="layui-input" id="remind_type" style="width:120px; line-height:35px;">'+remind_type+'</div>\
<div class="layui-input" id="type" style="width:120px; line-height:35px;">'+type+'</div>\
</td>\
</tr>\
<tr>\
<td class="layui-td-gray">日程内容<font>*</font></td>\
<td><input name="title" class="layui-input" value="'+detail.title+'" lay-verify="required" placeholder="请完成日程内容" lay-reqText="请完成日程内容"></td>\
<td class="layui-td-gray">优先级<font>*</font></td>\
<td class="layui-td-gray">提醒<font>*</font></td>\
<td>\
<div class="layui-input" id="type" style="width:120px; line-height:35px;">'+type+'</div>\
<div class="layui-input" id="remind_type" style="width:120px; line-height:35px;">'+remind_type+'</div>\
</td>\
</tr>\
<tr>\
@ -228,20 +228,34 @@ user-select: none;}
dropdown.render({
elem: '#type'
,data: [{
title: '<span class="layui-badge-dot"></span> 紧急',
title: '紧急',
templet: function(d){
return '<span class="layui-badge-dot"></span> ' + d.title;
},
id: 1
},{
title: '<span class="layui-badge-dot layui-bg-orange"></span> 重要',
title: '重要',
templet: function(d){
return '<span class="layui-badge-dot layui-bg-orange"></span> ' + d.title;
},
id: 2
},{
title: '<span class="layui-badge-dot layui-bg-blue"></span> 次要',
title: '次要',
templet: function(d){
return '<span class="layui-badge-dot layui-bg-blue"></span> ' + d.title;
},
id: 3
},{
title: '<span class="layui-badge-dot layui-bg-green"></span> 不重要',
title: '不重要',
templet: function(d){
return '<span class="layui-badge-dot layui-bg-green"></span> ' + d.title;
},
id: 4
},{
title: '<span class="layui-badge-dot layui-bg-black"></span> 无优先级',
title: '无优先级',
templet: function(d){
return '<span class="layui-badge-dot layui-bg-black"></span> ' + d.title;
},
id: 5
}]
,click: function(obj){

View File

@ -411,20 +411,34 @@
dropdown.render({
elem: '#type'
,data: [{
title: '<span class="layui-badge-dot"></span> 紧急',
title: '紧急',
templet: function(d){
return '<span class="layui-badge-dot"></span> ' + d.title;
},
id: 1
},{
title: '<span class="layui-badge-dot layui-bg-orange"></span> 重要',
title: '重要',
templet: function(d){
return '<span class="layui-badge-dot layui-bg-orange"></span> ' + d.title;
},
id: 2
},{
title: '<span class="layui-badge-dot layui-bg-blue"></span> 次要',
title: '次要',
templet: function(d){
return '<span class="layui-badge-dot layui-bg-blue"></span> ' + d.title;
},
id: 3
},{
title: '<span class="layui-badge-dot layui-bg-green"></span> 不重要',
title: '不重要',
templet: function(d){
return '<span class="layui-badge-dot layui-bg-green"></span> ' + d.title;
},
id: 4
},{
title: '<span class="layui-badge-dot layui-bg-black"></span> 无优先级',
title: '无优先级',
templet: function(d){
return '<span class="layui-badge-dot layui-bg-black"></span> ' + d.title;
},
id: 5
}]
,click: function(obj){