layui如何使用公共模块

2021-04-16 13:42发布

16条回答

注意:js文件名要和模块名一致

layui.define(['layer', 'laypage'], function(exports) {
    console.log("进入helloworld的define")
    var obj = {
        name : "yang",
        hello : function() {
            console.log("helloworld");
        }
    }
    exports('helloworld', obj);});


一周热门 更多>