需求是通过点击body页面,在其他地方就关闭这个<div>菜单,给这个div一个id:problemList,但是点击我打开的按钮,不关闭. created () { document.onclick = function () { // 要关闭的div的id (problemList) document.getElementById('problemList').style.display = 'none' } }, 点击按钮打开模态框的方法要写个阻止冒泡事件,不然会点不开 getItme(…