【发布时间】:2021-08-28 15:02:59
【问题描述】:
我想创建一个弹出框,但我也想给它一个 id。我试图通过设置这样的模板来实现这一点。但是当我尝试显示弹出框时,出现以下错误
$("#myElement").popover({
trigger: "manual",
placement: placement,
html: true,
template: `<div id="` + id + `" class="popover fade bs-popover-end" style="position: absolute; inset: 0px auto auto 0px; margin: 0px; transform: translate(788px, 615px);"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>`,
customClass: customClass,
content: content,
})
错误:
Uncaught TypeError: Cannot read property 'remove' of null
at Qe.getTipElement (popover.js:100)
at Qe.show (tooltip.js:241)
at HTMLImageElement.<anonymous> (popover.js:155)
at Function.each (jquery.min.js:2)
at S.fn.init.each (jquery.min.js:2)
at S.fn.init.jQueryInterface [as popover] (popover.js:147)
at PopoverList.Show (main.js:74)
【问题讨论】:
标签: javascript jquery popover