luoye

luoye VIP3

认证信息:layui 高级应用者

16380飞吻 2016-6-23 加入 来自lyg

(这个人懒得留下签名)

luoye 最近的提问

luoye 最近的回答

  • 5天前layer官方演示与讲解(jQuery弹出层插件)无法使用!请及时修改!中回答:



    测试正常[微笑] [微笑]
  • 2019-3-26 7:21:32layui 如何在form表单中动态新增文本框中回答:

    button默认点击就提交表单了
    所以你要设置 type="button" 属性
  • 2019-3-25 6:38:34动态加载select下拉框的选项时没有设置禁用为什么会自动禁用第一项中回答:

          <select name="city" lay-verify="required">
    <option value=""></option>
    <option value="0">北京</option>
    <option value="1">上海</option>
    <option value="2">广州</option>
    <option value="3">深圳</option>
    <option value="4">杭州</option>
    </select>
    这样写,你写的代码也不对。
    第一个option弄个空值
  • 2019-3-25 6:35:55LayEdit setContent 方法修正中回答:

    这问题一直没有修正的。
    因为layedit要有大变动
    [嘻嘻]
  • 2019-3-2 7:26:31layedit 使用setContent赋值就报错中回答:

    @冷妆 layedit.js 里有这个函数的
  • 2019-1-18 7:56:55说说 layui layer 弹窗 icon 参数数字对应的表情图标中回答:

    icon:0 感叹号
  • 2019-1-9 17:48:55网站集成layui的弹出框,点击弹出框的顶部X按钮,最小化,最大化按钮会出现跳转新页面的情况中回答:

    现在用的什么浏览器?
  • 2018-12-28 13:24:32页面连测试都做不了中回答:

    一、没有引入layui.js
    二、代码写的不对
    看文档 https://www.layui.com/doc/modules/layim.html
  • 2018-12-28 13:22:18table 模块的一点遗憾中回答:

    在parseData里把获取的数据处理一下不就可以了吗?
  • 2018-12-27 8:11:40校验账号是否存在,他不管存不存在都显示存在中回答:

    这样写就可以了
    var msg = '';
    $.ajax({
    url: '<%=basePath %>userServlet?action=getAccount',
    type: 'post',
    data: {'account':value},
    dataType: 'json',
    success: function (data) {
    if(data.code!=0){return "账号已存在!";}
    }
    });
    如返回的json格式 ,
    {
    "code":1
    ,msg:"账号已存在"
    }
    不知道你返回的数据是什么格式
  • 2018-12-5 11:54:44layui js文件和css文件分不同的文件夹存放,网页加载完毕之后,会报错中回答:

    https://www.layui.com/doc/#quickstart
    快速上手
    获得 layui 后,将其完整地部署到你的项目目录(或静态资源服务器)
    注意“完整”两个字
  • 2018-12-5 11:31:53模板引擎文档 - layui.laytpl 里面可以写递归方法吗中回答:

    @阿D哥
    简化了下

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>test1</title>
    <link rel="stylesheet" type="text/css" href="/Public/lib/layui/src/css/layui.css">
    <style type="text/css">
    .box{border:1px solid #ccc;margin:2px;padding:5px;margin-left:20px;}
    ul li{
    list-style-type: disc;
    }
    ul li li li{
    padding-left: 5px;
    }
    </style>
    </head>
    <body>
    <div class="layui-container">
    <div id="view"></div>
    </div>
    <script id="demo" type="text/html">
    {{#
    var fn = function(a){
    var result="";
    result=layui.laytpl(childtpl.innerHTML).render(a);
    return result;
    };
    }}
    <h3>{{ d.title }}</h3>
    <div class="box">
    <ul class="layui-nav layui-nav-tree" lay-filter="test">
    {{# layui.each(d.list, function(index, item){ }}
    <li class="layui-nav-item">
    <a href="javascript:;">{{item.modname}}</a>
    {{# if(item.child!=null){ }}

    {{ fn(item.child) }}

    {{# } }}
    </li>
    {{# }); }}
    {{# if(d.list.length === 0){ }}
    无数据
    {{# } }}
    </div>
    </ul>
    </script>
    <script id="childtpl" type="text/html">
    {{#
    var fn = function(a){
    var result="";
    result=layui.laytpl(childtpl.innerHTML).render(a);
    return result;
    };
    }}
    <ul class="layui-nav-child">
    {{# layui.each(d, function(index, item){ }}
    <li class="layui-nav-item">
    <a href="javascript:;">{{item.modname}}</a>
    {{# if(item.child!=null){ }}

    {{ fn(item.child) }}

    {{# } }}
    </li>
    {{# }); }}
    </ul>
    </script>

    <script type="text/javascript" src="/Public/lib/layui/src/layui.js"></script>
    <script type="text/javascript">
    layui.use(["laytpl","element"],function() {
    var laytpl=layui.laytpl,$=layui.jquery,element = layui.element;

    var data = { //数据
    "title":"Layui常用模块"
    ,"list":[
    {"modname":"弹层","alias":"layer","site":"layer.layui.com"}
    ,{"modname":"表单","alias":"form","site":"layui.com",child:[
    {"modname":"子表单","alias":"c-form",child:[
    {"modname":"孙-竖排表单","alias":"s-V-form"}
    ,{"modname":"孙-横排表单","alias":"s-H-form"
    ,child:[
    {"modname":"孙-孙-竖排表单","alias":"s-V-form"}
    ]
    }
    ]
    }]
    }
    ,{"modname":"弹层","alias":"layer","site":"layer.layui.com"}
    ,{"modname":"表单","alias":"form","site":"layui.com",child:[
    {"modname":"子表单","alias":"c-form",child:[
    {"modname":"孙-竖排表单","alias":"s-V-form"}
    ,{"modname":"孙-横排表单","alias":"s-H-form"}
    ]
    }]
    }
    ]
    }
    var getTpl = demo.innerHTML
    ,view = document.getElementById('view');
    laytpl(getTpl).render(data, function(html){
    view.innerHTML = html;
    element.render();
    });

    });
    </script>
    </body>
    </html>
  • 2018-12-5 11:19:1模板引擎文档 - layui.laytpl 里面可以写递归方法吗中回答:

    @阿D哥 这里用了递归
  • 2018-12-5 11:18:11模板引擎文档 - layui.laytpl 里面可以写递归方法吗中回答:


    递归菜单
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>test1</title>
    <link rel="stylesheet" type="text/css" href="/Public/lib/layui/src/css/layui.css">
    <style type="text/css">
    .box{border:1px solid #ccc;margin:2px;padding:5px;margin-left:20px;}
    ul li{
    list-style-type: disc;
    }
    </style>
    </head>
    <body>
    <div class="layui-container">


    <div id="view"></div>



    </div>
    <script id="demo" type="text/html">
    {{#
    var fn = function(a){
    var tt="";
    layui.laytpl(childtpl.innerHTML).render(a,function(html){
    tt=html;
    });
    return tt;
    };
    }}
    <h3>{{ d.title }}</h3>
    <div class="box">
    <ul class="layui-nav layui-nav-tree" lay-filter="test">
    {{# layui.each(d.list, function(index, item){ }}
    <li class="layui-nav-item">
    <a href="javascript:;">{{item.modname}}</a>
    {{# if(item.child!=null){ }}

    {{ fn(item.child) }}

    {{# } }}
    </li>
    {{# }); }}
    {{# if(d.list.length === 0){ }}
    无数据
    {{# } }}
    </div>
    </ul>
    </script>
    <script id="childtpl" type="text/html">
    {{#
    var fn = function(a){
    var tt="";
    layui.laytpl(childtpl.innerHTML).render(a,function(html){
    tt=html;
    });
    return tt;
    };
    }}
    <ul class="layui-nav-child">
    {{# layui.each(d, function(index, item){ }}
    <li class="layui-nav-item">
    <a href="javascript:;">{{item.modname}}</a>
    {{# if(item.child!=null){ }}

    {{ fn(item.child) }}

    {{# } }}
    </li>
    {{# }); }}
    </ul>
    </script>

    <script type="text/javascript" src="/Public/lib/layui/src/layui.js"></script>
    <script type="text/javascript">
    layui.use(["laytpl","element"],function() {
    var laytpl=layui.laytpl,$=layui.jquery,element = layui.element;

    var data = { //数据
    "title":"Layui常用模块"
    ,"list":[
    {"modname":"弹层","alias":"layer","site":"layer.layui.com"}
    ,{"modname":"表单","alias":"form","site":"layui.com",child:[
    {"modname":"子表单","alias":"c-form",child:[
    {"modname":"孙-竖排表单","alias":"s-V-form"}
    ,{"modname":"孙-横排表单","alias":"s-H-form"}
    ]
    }]
    }
    ,{"modname":"弹层","alias":"layer","site":"layer.layui.com"}
    ,{"modname":"表单","alias":"form","site":"layui.com",child:[
    {"modname":"子表单","alias":"c-form",child:[
    {"modname":"孙-竖排表单","alias":"s-V-form"}
    ,{"modname":"孙-横排表单","alias":"s-H-form"}
    ]
    }]
    }
    ]
    }
    var getTpl = demo.innerHTML
    ,view = document.getElementById('view');
    laytpl(getTpl).render(data, function(html){
    view.innerHTML = html;
    element.render();
    });

    });
    </script>
    </body>
    </html>
  • 2018-12-5 9:24:4模板引擎文档 - layui.laytpl 里面可以写递归方法吗中回答:

    @阿D哥 哦,哈哈
  • 2018-11-26 19:16:14按照官方例子,我的HelloWorld显示不出来中回答:

    layui整个文件夹要作为一个整体放到你的网站或本地目录
    并且路径要引用正确
  • 2018-11-20 12:52:33下拉按钮显示不了下拉框内容 一闪一闪的 改了z-index没有用中回答:

    内容属于 layuiadmin 会员专区,此处不予展示
  • 2018-11-20 12:48:43下拉按钮显示不了下拉框内容 一闪一闪的 改了z-index没有用中回答:

    内容属于 layuiadmin 会员专区,此处不予展示
  • 2018-11-19 6:45:1layui table中插入滑块中回答:

    @荒哦就没弄
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>滑块</title>
    <link rel="stylesheet" type="text/css" href="/Public/lib/layui/css/layui.css">
    <link rel="stylesheet" href="../selectlist.css">
    <style type="text/css">
    .slider{margin-top: 10px;}
    </style>
    </head>
    <body>
    <div class="layui-container">
    <div id="table">
    <table id="demo" lay-filter="testtable"></table>
    </div>
    </div>


    <script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="ceshi">测试</a>
    </script>
    <textarea class="layui-textarea" id="LAY_demo1" style="display: none" placeholder="123456">
    </textarea>
    <script type="text/html" id="titleTpl">
    <a href="javascript:;" title="/detail/{{d.id}}" class="layui-table-link">{{d.LAY_TABLE_INDEX}}</a>
    </script>
    <script type="text/html" id="sexTpl">
    <input type="checkbox" name="sex" value="{{d.id}}" lay-skin="switch" lay-filter="sexdemo" lay-text="男|女" {{d.sex=="男"?"checked":""}}>
    </script>
    <script type="text/html" id="radioTpl">
    <input type="radio" name="sexRadio" value="{{d.id}}" title=" " lay-filter="radiodemo" {{d.id=="10002"?"checked":""}}>
    </script>
    <script type="text/html" id="checkTpl">
    <input type="checkbox" name="sexCheck" value="{{d.id}}" title="锁定" lay-filter="checkdemo" {{d.id=="10002"?"checked":""}}>
    </script>
    <script type="text/html" id="selectTpl">
    <select>
    <option value="ss00">多发点0</option>
    <option value="ss11">多发点1</option>
    <option value="ss22">多发点2</option>
    </select>
    </script>
    <script type="text/javascript" src="/Public/lib/jquery.min.js"></script>
    <script type="text/javascript" src="/Public/lib/layui/src/layui.js"></script>
    <!-- <script type="text/javascript" src="/layui/src/layui.js"></script> -->
    <script type="text/javascript">
    layui.use(["table","laytpl","form","laydate","slider"],function() {
    var table=layui.table,laytpl=layui.laytpl,form=layui.form,$=layui.jquery,laydate=layui.laydate,slider=layui.slider;

    //展示已知数据
    table.render({
    elem: '#demo'
    ,id:"democc"
    ,data: [{
    "id": "10001"
    ,"username": "杜甫"
    ,"email": "xianxin@layui.com"
    ,"sex": "男"
    ,"city": "浙江杭州"
    ,"sign": "人生恰似一场修行"
    ,"experience": "116"
    ,"ip": "192.168.0.8"
    ,"logins": "108"
    ,"joinTime": "1507353913000"
    ,"pic":"20100129084340872.jpg"
    }, {
    "id": "10002"
    ,"username": "李白"
    ,"email": "xianxin@layui.com"
    ,"sex": "男"
    ,"city": "浙江杭州"
    ,"sign": "人生恰似一场修行"
    ,"experience": "12"
    ,"ip": "192.168.0.8"
    ,"logins": "106"
    ,"joinTime": "2016-10-14"
    ,"pic":"20100129084340872.jpg"
    }, {
    "id": "10008"
    ,"username": "贤心"
    ,"email": "xianxin@layui.com"
    ,"sex": "男"
    ,"city": "浙江杭州"
    ,"sign": "人生恰似一场修行"
    ,"experience": "106"
    ,"ip": "192.168.0.8"
    ,"logins": "106"
    ,"joinTime": "2016-10-14"
    ,"pic":"20100129084340872.jpg"
    }]
    ,cellMinWidth:100
    ,cols: [[ //标题栏
    {type:"numbers",fixed:"left"}
    ,{type:"checkbox",fixed:"left"} //默认全选加,LAY_CHECKED:true
    ,{field: 'id', title: 'ID', sort: true,unresize:true}
    ,{field: 'username', title: '用户名',unresize:true}
    ,{field: 'slider', title: '滑块',templet:"<div><div class='slider'></div></div>"}
    ,{field: 'experience', title: '积分', sort: true,event:"jifen"}
    ,{fixed: 'right', title: '操作',width:120, align:'center', toolbar: '#barDemo'}
    ]]
    ,skin: 'line' //表格风格
    ,done:function(res, curr, count) {
    $("#table .slider").each(function(i,item) {
    $(this).attr("id","slider-"+i);
    slider.render({
    elem:"#slider-"+i
    ,change:function(value) {
    console.log(value);
    }
    });
    });
    }
    });
    });

    </script>
    </body>
    </html>
  • 2018-11-17 19:42:42layui table中插入滑块中回答:

    @荒哦就没弄 动态表格,明天把代码发你看看吧
  • 2018-11-15 13:12:57layui table中插入滑块中回答:

    调一下css
    比如设置margin-top:10px;
  • 2018-11-12 21:24:2下拉按钮显示不了下拉框内容 一闪一闪的 改了z-index没有用中回答:

    内容属于 layuiadmin 会员专区,此处不予展示
  • 2018-11-11 7:18:10模板产品价格有个bug中回答:

    199是灯具的钱
    200元只送模板不送灯具[嘻嘻]
  • 2018-11-1 17:17:36layui 2.4.5 发布中回答:

    [good] [good] [good] [赞] [赞] [赞]
  • 2018-10-29 8:10:21layui 2.4.4 发布中回答:

    [good]
  • 2018-10-21 19:24:50Fly社区的表单问题中回答:

    默认的action 是页面当前的地址
  • 2018-8-29 9:25:29layui 2.4.1 发布,优化了 2.4.0 的多个槽点中回答:

    [赞] 给个赞
  • 2018-8-27 12:47:29layui富文本回显layedit.setContent is not a function中回答:

    @流年java 说明你修改的地方不对,或者更新一下缓存
  • 2018-8-27 6:37:2layui富文本回显layedit.setContent is not a function中回答:

    源码中setContent方法中的layedit改成this
  • 2018-8-4 19:2:58模板引擎文档 - layui.laytpl 里面可以写递归方法吗中回答:

    http://www.layui.com/admin/pro
    左侧菜单就是递归