<div id="drawer">
<div id="side" style="display:none;">
<i class="layui-icon layui-icon-set" id='tig'></i>
</div>
layui.config({
base: './js/'
}).extend({
drawer: 'layDrawer'
});
layui.use(['drawer'], function () {
var drawer = layui.drawer;
drawer.render({
//trigger和elem只能为id
trigger: '#tig'
, elem: '#side'
//top bottom left right 默认为left
, position: 'right'
//默认为230 可以填百分比
, specs: '230'
, open: function () {
layer.msg("打开")
}
, close: function () {
layer.msg("关闭")
}
});
});