layui的监听事件中报错element.on is not a function?

时间:2020-05-08 10:39:04

layui的监听事件中报错element.on is not a function?

添加layui做tab标签切换时添加table时报错  element.on is not a function

layui.config({
       // version: 1,
        //base: '__ADM_PUBLIC__/layui/echarts/'
    }).use(['layer', 'form','laypage','common', 'icheck','laytpl','element', 'echarts', 'carousel', 'table'], function () {
        var element = layui.element,
            $ = layui.jquery,
            carousel = layui.carousel,
            table = layui.table, 
            echarts = layui.echarts;
        //建造轮播实例
        carousel.render({
            elem: '#Notice_carousel'
          , width: '100%' //设置容器宽度
            , height: '300px'
          , arrow: 'none' //不显示箭头
            , indicator: 'outside'//lay-indicator:outside
            , autoplay: false//自动切换
            , trigger: 'hover'//悬浮切换
            //,anim: 'updown' //切换动画方式默认左右
        });
})

var element = layui.element,

修改为:

var element = layui.element(),

猜你喜欢

版权所有:2019-2021 无双建设   网站地图