给a超级链接增加点击layui.open()方法
话不多说,上代码:
html
<a href="javascript:;" id="formLink">
我是要显示的文字
<input type="hidden" value="{ $url }" id="content">
</a>
js
$('#formLink').on('click', function(){
let href = $('#content').val()
//console.log(href);
layer.open({
type: 2,
title: '新增',
shade: 0.1,
area: ['80%', '80%'],
content: href,
});
});