/**Layui轮播类说明
 * @parameter 传递的参数{}，参数如下：
 ** elem: "", // 绑定元素，(必填项) 指向容器选择器 类型（ string / object）
 */
class lay_carousel {
    constructor(parameter = {}) {
        this.parameter = parameter;
        let that = this;
        layui.use(['carousel'], function () {
            var carousel = layui.carousel;
            that.carousel = carousel.render(that.parameter);
        });
    };
    /**
     * 评分类的参数提示
     */
    static config = {
        elem: "elem",
        width: "width",
        height: "height",
        full: "full",
        anim: "anim",
        autoplay: "autoplay",
        interval: "interval",
        index: "index",
        arrow: "arrow",
        indicator: "indicator",
        trigger: "trigger"
    };
    static anim = {
        default: "default",
        updown: "updown",
        fade: "fade"
    }
    static arrow = {
        hover: "hover",
        always: "always",
        none: "none"
    }
    static indicator = {
        inside: "inside",
        outside: "outside",
        none: "none"
    }
    static change(filter = '', func) {
        layui.use(['carousel'], function () {
            var carousel = layui.carousel;
            carousel.on('change(' + filter + ')', func);
        });
    }
    reload(parameter) {
        let that = this
        layui.use(['carousel'], function () {
            var carousel = layui.carousel;
            that.carousel = that.carousel.reload(parameter)
        });
    }
};

export default lay_carousel;