js version
window.open('','_self');window.close();
can be placed inside the a tag
<a href="javascript:window.opener=null;window.open('','_self');window.close();">关闭</a>
It can also be used in vue, with the secondary confirmation box of elementUI.