server/aspnetapp/wwwroot/lib/layim-v3.9.1/src/lay/modules/upload.js

(开头部分) 19KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/**

 @Title: layui.upload 文件上传
 @Author: 贤心
 @License:MIT

 */

layui.define('layer', function (exports) {
    "use strict";

    var $ = layui.$
        , layer = layui.layer
        , hint = layui.hint()
        , device = layui.device()

        //外部接口
        , upload = {
            config: {} //全局配置项

            //设置全局项
            , set: function (options) {
                var that = this;
                that.config = $.extend({}, that.config, options);
                return that;
            }

            //事件监听
            , on: function (events, callback) {
                return layui.onevent.call(this, MOD_NAME, events, callback);
            }
        }

        //操作当前实例
        , thisUpload = function () {
            var that = this;
            return {
                upload: function (files) {
                    that.upload.call(that, files);
                }
                , reload: function (options) {
                    that.reload.call(that, options);
                }
                , config: that.config
            }
        }

        //字符常量
        , MOD_NAME = 'upload', ELEM = '.layui-upload', THIS = 'layui-this', SHOW = 'layui-show', HIDE = 'layui-hide', DISABLED = 'layui-disabled'

        , ELEM_FILE = 'layui-upload-file', ELEM_FORM = 'layui-upload-form', ELEM_IFRAME = 'layui-upload-iframe', ELEM_CHOOSE = 'layui-upload-choose', ELEM_DRAG = 'layui-upload-drag'


        //构造器
        , Class = function (options) {
            var that = this;
            that.config = $.extend({}, that.config, upload.config, options);
            that.render();
        };

后面还有 495 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。