From e42b68739352f003ade5621cb9166f2c60ef8523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Tue, 8 Aug 2023 17:47:21 +0800 Subject: [PATCH] =?UTF-8?q?**=E8=B0=83=E6=95=B4**=20dropdown=20=E7=9A=84?= =?UTF-8?q?=20`data.title`=20=E5=B1=9E=E6=80=A7=EF=BC=8C=E5=AF=B9=E5=85=B6?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=20HTML=20=E8=BD=AC=E4=B9=89=E5=A4=84?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E8=8B=A5=E4=B8=8D=E8=BD=AC=E4=B9=89=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E9=80=9A=E8=BF=87=20`templet`=20=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/dropdown.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/dropdown.js b/src/modules/dropdown.js index 3fff8352..8681d4d8 100644 --- a/src/modules/dropdown.js +++ b/src/modules/dropdown.js @@ -3,11 +3,12 @@ * 下拉菜单组件 */ -layui.define(['jquery', 'laytpl', 'lay'], function(exports){ +layui.define(['jquery', 'laytpl', 'lay', 'util'], function(exports){ "use strict"; var $ = layui.$; var laytpl = layui.laytpl; + var util = layui.util; var hint = layui.hint(); var device = layui.device(); var clickOrMousedown = (device.mobile ? 'touchstart' : 'mousedown'); @@ -175,7 +176,7 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){ : laytpl(templet).render(item); } return title; - }(item.title); + }(util.escape(item.title)); // 初始类型 var type = function(){