/*! * Name: vue-upload-component * Version: 2.8.2 * Author: LianYue */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist"; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 21); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file. // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. module.exports = function normalizeComponent ( rawScriptExports, compiledTemplate, functionalTemplate, injectStyles, scopeId, moduleIdentifier /* server only */ ) { var esModule var scriptExports = rawScriptExports = rawScriptExports || {} // ES6 modules interop var type = typeof rawScriptExports.default if (type === 'object' || type === 'function') { esModule = rawScriptExports scriptExports = rawScriptExports.default } // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (compiledTemplate) { options.render = compiledTemplate.render options.staticRenderFns = compiledTemplate.staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = injectStyles } if (hook) { var functional = options.functional var existing = functional ? options.render : options.beforeCreate if (!functional) { // inject component registration as beforeCreate hook options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } else { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file options.render = function renderWithStyleInjection (h, context) { hook.call(context) return existing(h, context) } } } return { esModule: esModule, exports: scriptExports, options: options } } /***/ }), /* 1 */ /***/ (function(module, exports) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function (useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if (item[2]) { return "@media " + item[2] + "{" + content + "}"; } else { return content; } }).join(""); }; // import a list of modules into the list list.i = function (modules, mediaQuery) { if (typeof modules === "string") modules = [[null, modules, ""]]; var alreadyImportedModules = {}; for (var i = 0; i < this.length; i++) { var id = this[i][0]; if (typeof id === "number") alreadyImportedModules[id] = true; } for (i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if (typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { if (mediaQuery && !item[2]) { item[2] = mediaQuery; } else if (mediaQuery) { item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra Modified by Evan You @yyx990803 */ var hasDocument = typeof document !== 'undefined' if (typeof DEBUG !== 'undefined' && DEBUG) { if (!hasDocument) { throw new Error( 'vue-style-loader cannot be used in a non-browser environment. ' + "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." ) } } var listToStyles = __webpack_require__(36) /* type StyleObject = { id: number; parts: Array } type StyleObjectPart = { css: string; media: string; sourceMap: ?string } */ var stylesInDom = {/* [id: number]: { id: number, refs: number, parts: Array<(obj?: StyleObjectPart) => void> } */} var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) var singletonElement = null var singletonCounter = 0 var isProduction = false var noop = function () {} var options = null var ssrIdKey = 'data-vue-ssr-id' // Force single-tag solution on IE6-9, which has a hard limit on the # of \n\n```\n\n\n** OR **\n\n\n```js\nimport FileUpload from 'vue-upload-component/src'\n```\n\n\nwebpack.config.js\n\n```js\nconst nodeExternals = require('webpack-node-externals');\n{\n //.....\n externals: [\n nodeExternals({whitelist:[/^vue-upload-component\\/src/]})\n ]\n //.....\n}\n```\n\n* [https://github.com/liady/webpack-node-externals](https://github.com/liady/webpack-node-externals)\n\n* [**`vue-hackernews` demo**](https://github.com/lian-yue/vue-hackernews-2.0/)\n\n* [**View changes**](https://github.com/lian-yue/vue-hackernews-2.0/commit/bd6c58a30cc6b8ba6c0148e737b3ce9336b99cf8)\n\n\n\n\n## Options / Props\n\n\n### input-id\n\nThe `id` attribute of the input tag\n\n* **Type:** `String`\n\n* **Default:** `this.name`\n\n* **Usage:**\n ```html\n \n \n \n ```\n\n\n\n\n\n### name\n\nThe `name` attribute of the input tag\n\n* **Type:** `String`\n\n* **Default:** `file`\n\n* **Usage:**\n ```html\n \n \n \n ```\n\n\n\n\n\n### post-action\n\n`POST` Request upload URL\n\n* **Type:** `String`\n\n* **Default:** `undefined`\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n\n\n### put-action\n\n`PUT` Request upload URL\n\n* **Type:** `String`\n\n* **Default:** `undefined`\n\n* **Browser:** `> IE9`\n\n* **Details:**\n\n `put-action` is not empty Please give priority to` PUT` request\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n### custom-action\n\nCustom upload method\n\n* **Type:** `async Function`\n\n* **Default:** `undefined`\n\n* **Details:** \n\n `custom-action` priority than `put-action, post-action`\n\n* **Usage:**\n ```html\n \n ```\n ```js\n async function customAction(file, component) {\n // return await component.uploadPut(file)\n return await component.uploadHtml4(file)\n }\n ```\n\n\n\n\n\n### headers\n\nAttach `header` data\n\n* **Type:** `Object`\n\n* **Default:** `{}`\n\n* **Browser:** `> IE9`\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n\n\n### data\n\n`POST request`: Append request `body`\n`PUT request`: Append request `query`\n\n* **Type:** `Object`\n\n* **Default:** `{}`\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n\n### value, v-model\n\nFile List\n\n* **Type:** `Array`\n\n* **Default:** `[]`\n\n* **Details:**\n\n View **[`File`](#file)** details\n > In order to prevent unpredictable errors, can not directly modify the `files`, please use [`add`](#instance-methods-add), [`update`](#instance-methods-update), [`remove`](#instance-methods-remove) method to modify\n\n* **Usage:**\n ```html\n \n \n \n ```\n\n\n\n\n\n### accept\n\nThe `accept` attribute of the input tag, MIME type\n\n* **Type:** `String`\n\n* **Default:** `undefined`\n\n* **Browser:** `> IE9`\n\n* **Usage:**\n ```html\n \n \n \n ```\n\n\n\n\n\n### multiple\n\nThe `multiple` attribute of the input tag\nWhether to allow multiple files to be selected\n\n* **Type:** `Boolean`\n\n* **Default:** `false`\n\n* **Details:**\n\n If it is `false` file inside only one file will be automatically deleted\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n### directory\n\nThe `directory` attribute of the input tag\nWhether it is a upload folder\n\n* **Type:** `Boolean`\n\n* **Default:** `false`\n\n* **Browser:** [http://caniuse.com/#feat=input-file-directory](http://caniuse.com/#feat=input-file-directory)\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n\n\n### extensions\n\nAllow upload file extensions\n\n* **Type:** `Array | String | RegExp`\n\n* **Default:** `undefined`\n\n* **Usage:**\n ```html\n \n \n \n \n \n ```\n\n\n\n\n### size\n\nAllow the maximum byte to upload\n\n* **Type:** `Number`\n\n* **Default:** `0`\n\n* **Browser:** `> IE9`\n\n* **Details:**\n\n `0` is equal to not limit\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n\n### timeout\n\nUpload timeout time in milliseconds\n\n* **Type:** `Number`\n\n* **Default:** `0`\n\n* **Browser:** `> IE9`\n\n* **Usage:**\n ```html\n \n ```\n\n### maximum\n\nList the maximum number of files\n\n* **Type:** `Number`\n\n* **Default:** `props.multiple ? 0 : 1`\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n### thread\n\nAlso upload the number of files at the same time (number of threads)\n\n* **Type:** `Number`\n\n* **Default:** `1`\n\n* **Browser:** `> IE9`\n\n* **Usage:**\n ```html\n \n ```\n\n### chunk-enabled\n\nWhether chunk uploads is enabled or not\n\n* **Type:** `Boolean`\n\n* **Default:** `false`\n\n* **Usage:**\n ```html\n \n \n ```\n\n### chunk\n\nAll the options to handle chunk uploads\n\n* **Type:** `Object`\n\n* **Default:**\n```js\n{\n headers: {\n 'Content-Type': 'application/json'\n },\n action: '',\n minSize: 1048576,\n maxActive: 3,\n maxRetries: 5,\n\n // This is the default Handler implemented in this package\n // you can use your own handler if your protocol is different\n handler: ChunkUploadDefaultHandler\n}\n```\n\n### drop\n\nDrag and drop upload\n\n* **Type:** `Boolean | Element | CSS selector`\n\n* **Default:** `false`\n\n* **Browser:** [http://caniuse.com/#feat=dragndrop](http://caniuse.com/#feat=dragndrop)\n\n* **Details:**\n\n If set to `true`, read the parent component as a container\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n\n\n### drop-directory\n\nWhether to open the drag directory\n\n* **Type:** `Boolean`\n\n* **Default:** `true`\n\n* **Details:**\n\n If set to `false` filter out the directory\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n### add-index\n\n* **Type:** `Boolean, Number`\n\n* **Default:** `undefined`\n\n* **Version:** : `>=2.6.1`\n\n* **Details:**\n\n The default value of the `index` parameter for the [`add()`](#instance-methods-add) method\n\n* **Usage:**\n ```html\n \n ```\n\n\n\n\n## Options / Events\n\nThe files is changed to trigger the method\nDefault for `v-model` binding\n\n### @input\n* **Arguments:**\n\n * `files: Array`\n\n\n* **Usage:**\n ```html\n \n \n ```\n\n\n\n### @input-filter\n\nAdd, update, remove pre-filter\n\n* **Arguments:**\n\n * `newFile: File | Object | undefined` `Read and write`\n * `oldFile: File | Object | undefined` `Read only`\n * `prevent: Function` Call this function to prevent modification\n\n\n* **Details:**\n\n If the `newFile` value is `undefined` 'is deleted\n If the `oldFile` value is `undefined` 'is added\n If `newFile`, `oldFile` is exist, it is updated\n\n > Synchronization modify `newFile`\n > Asynchronous Please use `update`,` add`, `remove`,` clear` method\n > Asynchronous Please set an error first to prevent being uploaded\n\n > Synchronization can not use `update`,` add`, `remove`,` clear` methods\n > Asynchronous can not modify `newFile`\n\n* **Usage:**\n ```html\n \n \n ```\n\n### @input-file\n\nAdd, update, remove after\n\n* **Arguments:**\n\n * `newFile: File | Object | undefined` `Read only`\n * `oldFile: File | Object | undefined` `Read only`\n\n\n* **Details:**\n\n If the `newFile` value is `undefined` 'is deleted\n If the `oldFile` value is `undefined` 'is added\n If `newFile`, `oldFile` is exist, it is updated\n\n\n >You can use `update`,` add`, `remove`,` clear` methods in the event\n >You can not modify the `newFile` object in the event\n >You can not modify the `oldFile` object in the event\n\n* **Usage:**\n ```html\n \n \n ```\n\n\n\n## Instance / Data\n\n### features\n\nUsed to determine the browser support features\n\n* **Type:** `Object`\n\n* **Read only:** `true`\n\n* **Default:** `{ html5: true, directory: false, drag: false }`\n\n* **Usage:**\n ```html\n \n \n Support drag and drop upload\n Support folder upload\n Support for HTML5\n \n ```\n\n\n\n### active\n\nActivation or abort upload\n\n* **Type:** `Boolean`\n\n* **Read only:** `false`\n\n* **Default:** `false`\n\n* **Usage:**\n ```html\n \n \n Start upload\n Stop upload\n \n ```\n\n\n\n### dropActive\n\nIs dragging\n\n* **Type:** `Boolean`\n\n* **Read only:** `true`\n\n* **Default:** `false`\n\n* **Usage:**\n ```html\n \n \n Drag and drop here for upload\n \n ```\n\n\n\n\n\n### uploaded\n\nAll uploaded\n\n* **Type:** `Boolean`\n\n* **Read only:** `true`\n\n* **Default:** `true`\n\n* **Usage:**\n ```html\n \n \n All files have been uploaded\n \n ```\n\n\n\n\n\n## Instance / Methods\n\n\n\n### get()\n\nUse `id` to get a file object\n\n* **Arguments:**\n\n * `id: File | Object | String`\n\n\n* **Result:** `File | Object | Boolean` There is a return file, object that otherwise returns `false`\n\n\n\n### add()\n\nAdd one or more files\n\n* **Arguments:**\n\n * `files: Array | File | window.File | Object` If it is an array of responses will be an array\n * `index: Number | Boolean` = [`props.add-index`](#options-props-add-index) `true = ` Start, `false = ` End, `Number = ` Index\n\n\n* **Result:** `Object | Array | Boolean` The incoming array is returned to the array otherwise the object or `false`\n\n* **Usage:**\n ```html\n \n \n ```\n\n\n### addInputFile()\n\nAdd the file selected by `` to the upload list\n\n* **Arguments:**\n\n * `el: HTMLInputElement` File element\n\n\n* **Result:** `Array` Added list of files\n\n* **Version:** : `>=2.5.1`\n\n\n\n### addDataTransfer()\n\nAdd files that are dragged or pasted into the upload list\n\n* **Arguments:**\n\n * `dataTransfer: DataTransfer` Drag or paste data\n\n\n* **Result:** `Promise>` Added list of files\n\n\n* **Version:** : `>=2.5.1`\n\n\n\n### update()\n\nUpdate a file object\n\n* **Arguments:**\n\n * `id: File | Object | String`\n * `data: Object` Updated data object\n\n\n* **Result:** `Object | Boolean` Successfully returned `newFile` failed to return` false`\n\n\n* **Usage:**\n ```html\n \n \n ```\n\n### remove()\n\nRemove a file object\n\n* **Arguments:**\n\n * `id: File | Object | String`\n\n\n* **Result:** `Object | Boolean` Successfully returned `oldFile` failed to return` false`\n\n* **Usage:**\n ```html\n \n \n ```\n\n### replace()\n Replace the location of the two files\n\n* **Arguments:**\n\n * `id1: File | Object | String`\n * `id2: File | Object | String`\n\n\n* **Result:** `Boolean`\n\n\n### clear()\n\nEmpty the file list\n\n* **Result:** `Boolean` Always return `true`\n\n\n\n## Instance / File\n\n\n\n> **File object in the `@input-filter` event outside the use of [`update`](#instance-methods-update) method**\n\n\n\n\n### fileObject\n\n* **Type:** `Boolean`\n\n* **Read only:** `true`\n\n* **Required:** `true`\n\n* **Default:** `true`\n\n* **Version:** : `>=2.6.0`\n\n* **Details:**\n\n If the attribute does not exist, the object will not be processed internally\n If the attribute does not exist, it is not `File` but `Object`\n\n\n\n\n### id\n\nFile ID\n\n* **Type:** `String | Number`\n\n* **Read only:** `false`\n\n* **Default:** `Math.random().toString(36).substr(2)`\n\n* **Details:**\n\n >`id` can not be repeated\n >Upload can not modify `id`\n\n\n### size\n\nFile size\n\n* **Type:** `Number`\n\n* **Read only:** `false`\n\n* **Default:** `-1`\n\n* **Browser:** `> IE9`\n\n\n### name\n\nFilename\n\n* **Type:** `String`\n\n* **Read only:** `false`\n\n* **Default:** ` `\n\n* **Details:**\n\n Format: `directory/filename.gif` `filename.gif`\n\n\n\n### type\n\nMIME type\n\n* **Type:** `String`\n\n* **Read only:** `false`\n\n* **Default:** ` `\n\n* **Browser:** `> IE9`\n\n* **Details:**\n\n Format: `image/gif` `image/png` `text/html`\n\n\n\n\n### active\n\nActivation or abort upload\n\n* **Type:** `Boolean`\n\n* **Read only:** `false`\n\n* **Default:** `false`\n\n* **Details:**\n\n `true` = Upload\n `false` = Abort\n\n\n\n\n\n\n### error\n\nUpload failed error code\n\n* **Type:** `String`\n\n* **Read only:** `false`\n\n* **Default:** ` `\n\n* **Details:**\n\n Built-in\n `size`, `extension`, `timeout`, `abort`, `network`, `server`, `denied`\n\n\n\n\n### success\n\nWhether the upload was successful\n\n* **Type:** `Boolean`\n\n* **Read only:** `false`\n\n* **Default:** `false`\n\n\n### putAction\n\nCustomize the current file `PUT` URL\n\n* **Type:** `String`\n\n* **Read only:** `false`\n\n* **Default:** `this.putAction`\n\n\n\n### postAction\n\nCustomize the current file `POST` URL\n\n* **Type:** `String`\n\n* **Read only:** `false`\n\n* **Default:** `this.postAction`\n\n\n\n\n### headers\n\nCustomize the current file `HTTP` Header\n\n* **Type:** `Object`\n\n* **Read only:** `false`\n\n* **Default:** `this.headers`\n\n\n### data\n\nCustomize the current file `body` or` query` to attach content\n\n* **Type:** `Object`\n\n* **Read only:** `false`\n\n* **Default:** `this.data`\n\n\n### timeout\n\nCustomize the upload timeout for a current single file\n\n* **Type:** `Number`\n\n* **Read only:** `false`\n\n* **Default:** `this.timeout`\n\n\n### response\n\nResponse data\n\n* **Type:** `Object | String`\n\n* **Read only:** `false`\n\n* **Default:** `{}`\n\n\n\n\n### progress\n\nUpload progress\n\n* **Type:** `String`\n\n* **Read only:** `false`\n\n* **Default:** `0.00`\n\n* **Browser:** `> IE9`\n\n\n\n### speed\n\nPer second upload speed\n\n* **Type:** `Number`\n\n* **Read only:** `true`\n\n* **Default:** `0`\n\n* **Browser:** `> IE9`\n\n\n\n\n### xhr\n\n`HTML5` upload` XMLHttpRequest` object\n\n* **Type:** `XMLHttpRequest`\n\n* **Read only:** `true`\n\n* **Default:** `undefined`\n\n* **Browser:** `> IE9`\n\n\n\n\n### iframe\n\n`HTML4` upload` iframe` element\n\n* **Type:** `Element`\n\n* **Read only:** `true`\n\n* **Default:** `undefined`\n\n* **Browser:** `= IE9`\n" /***/ }), /* 9 */ /***/ (function(module, exports) { module.exports = "## 入门开始\n\n### NPM\n\n``` bash\nnpm install vue-upload-component --save\n```\n\n``` js\nconst VueUploadComponent = require('vue-upload-component')\nVue.component('file-upload', VueUploadComponent)\n```\n\n### Curated\n\n**No data**\n\n\n### 直接使用\n\n\nunpkg\n\n``` html\n\n\n\n```\n\njsDelivr\n\n``` html\n\n\n\n```\n\n\n### 简单的例子\n\n\n\n```html\n\n\n\n \n Vue-upload-component Test\n \n \n\n\n
\n
    \n
  • {{file.name}} - Error: {{file.error}}, Success: {{file.success}}
  • \n
\n \n 上传文件\n \n \n \n
\n\n\n\n```\n\n\n\n### SSR (服务器同构)\n\n\n```html\n\n\n\n```\n\n\n** 或者 **\n\n\n```js\nimport FileUpload from 'vue-upload-component/src'\n```\n\nwebpack.config.js\n\n```js\nconst nodeExternals = require('webpack-node-externals');\n{\n //...\n externals: [\n nodeExternals({whitelist:[/^vue-upload-component\\/src/]})\n ]\n //...\n}\n```\n\n* [https://github.com/liady/webpack-node-externals](https://github.com/liady/webpack-node-externals) \n\n* [**`vue-hackernews` 演示**](https://github.com/lian-yue/vue-hackernews-2.0/) \n\n* [**浏览修改文件**](https://github.com/lian-yue/vue-hackernews-2.0/commit/bd6c58a30cc6b8ba6c0148e737b3ce9336b99cf8)\n\n\n\n\n## 选项 / 属性\n\n\n### input-id\n\ninput 标签的 `id` 属性\n\n* **类型:** `String`\n\n* **默认值:** `this.name`\n\n* **示例:**\n ```html\n \n \n \n ```\n\n\n\n\n\n### name\n\ninput标签的 `name` 属性\n\n* **类型:** `String`\n\n* **默认值:** `file`\n\n* **示例:**\n ```html\n \n \n \n ```\n\n\n\n\n\n### post-action\n\n`POST` 请求的上传URL\n\n* **类型:** `String`\n\n* **默认值:** `undefined`\n\n* **示例:**\n ```html\n \n ```\n\n\n\n\n\n### put-action\n\n`PUT` 请求的上传URL\n\n* **类型:** `String`\n\n* **默认值:** `undefined`\n\n* **浏览器:** `> IE9`\n\n* **详细:** \n\n `put-action` 不为空请优先 `PUT` 请求 \n\n* **示例:**\n ```html\n \n ```\n\n\n\n### custom-action\n\n自定义上传方法\n\n* **类型:** `async Function`\n\n* **默认值:** `undefined`\n\n* **详细:** \n\n `custom-action` 优先级高于 `put-action, post-action`\n\n* **示例:**\n ```html\n \n ```\n ```js\n async function customAction(file, component) {\n // return await component.uploadPut(file)\n return await component.uploadHtml4(file)\n }\n ```\n\n\n\n### headers\n\n自定义上传请求 `header` 数据\n\n* **类型:** `Object`\n\n* **默认值:** `{}`\n\n* **浏览器:** `> IE9`\n\n* **示例:**\n ```html\n \n ```\n\n\n\n\n\n### data\n\n`POST 请求`: 附加请求的 body \n`PUT 请求`: 附加请求的 query \n\n* **类型:** `Object`\n\n* **默认值:** `{}`\n\n* **示例:**\n ```html\n \n ```\n\n\n\n\n### value, v-model\n\n文件列表\n\n* **类型:** `Array`\n\n* **默认值:** `[]`\n\n* **详细:** \n\n 浏览 **[`File`](#file)** 详细信息 \n > 为了防止不可预知的错误,不可直接修改 `files`,请使用 [`add`](#实例-方法-add), [`update`](#实例-方法-update), [`remove`](#实例-方法-remove) 方法修改\n\n* **示例:**\n ```html\n \n \n \n ```\n\n\n\n\n\n### accept\n\n表单的`accept`属性, MIME type \n\n* **类型:** `String`\n\n* **默认值:** `undefined`\n\n* **浏览器:** `> IE9`\n\n* **示例:**\n ```html\n \n \n \n ```\n\n\n\n\n\n### multiple\n\n文件表单的 `multiple` 属性 \n是否允许选择多个文件 \n\n* **类型:** `Boolean`\n\n* **默认值:** `false`\n\n* **详细:** \n\n 如果是 `false` `files` 里面最多只有一个文件 多的会自动删除 \n\n* **示例:**\n ```html\n \n ```\n\n\n\n### directory\n\n文件表单的 `directory` 属性 \n是否是上传文件夹 \n\n* **类型:** `Boolean`\n\n* **默认值:** `false`\n\n* **浏览器:** [http://caniuse.com/#feat=input-file-directory](http://caniuse.com/#feat=input-file-directory)\n\n* **示例:**\n ```html\n \n ```\n\n\n\n\n\n### extensions\n\n允许上传的文件后缀\n\n* **类型:** `Array | String | RegExp`\n\n* **默认值:** `undefined`\n\n* **示例:**\n ```html\n \n \n \n \n \n ```\n\n\n\n\n### size\n\n允许上传的最大字节\n\n* **类型:** `Number`\n\n* **默认值:** `0`\n\n* **浏览器:** `> IE9`\n\n* **详细:**\n\n `0` 等于不限制\n\n* **示例:**\n ```html\n \n ```\n\n\n\n\n### timeout\n\n上传超时时间毫秒\n\n* **类型:** `Number`\n\n* **默认值:** `0`\n\n* **浏览器:** `> IE9`\n\n* **示例:**\n ```html\n \n ```\n\n\n### maximum\n\n列表最大文件数\n\n* **类型:** `Number`\n\n* **默认值:** `props.multiple ? 0 : 1`\n\n* **示例:**\n ```html\n \n ```\n\n\n\n\n### thread\n\n同时并发上传的文件数量 线程数 \n\n* **类型:** `Number`\n\n* **默认值:** `1`\n\n* **浏览器:** `> IE9`\n\n* **示例:**\n ```html\n \n ```\n\n\n\n\n\n### drop\n\n拖拽上传 \n\n* **类型:** `Boolean | Element | CSS selector`\n\n* **默认值:** `false`\n\n* **浏览器:** [http://caniuse.com/#feat=dragndrop](http://caniuse.com/#feat=dragndrop)\n\n* **详细:**\n\n 如果设置成 `true` 则读取父组件作为容器 \n\n* **示例:**\n ```html\n \n ```\n\n\n\n\n\n### drop-directory\n\n是否开启拖拽目录 \n\n* **类型:** `Boolean`\n\n* **默认值:** `true`\n\n* **详细:**\n\n 如果设置成 `false` 则过滤掉目录\n\n* **示例:**\n ```html\n \n ```\n\n\n### add-index\n\n* **类型:** `Boolean, Number`\n\n* **默认值:** `undefined`\n\n* **版本:** `>= 2.6.1`\n\n* **详细:**\n\n [`add()`](#实例-方法-add) 方法 `index` 参数的默认值\n\n* **示例:**\n ```html\n \n ```\n\n\n\n## 选项 / 事件\n\n文件被改变触发的方法 \n默认用于`v-model`绑定\n\n### @input\n* **参数:**\n\n * `files: Array`\n\n\n* **示例:**\n ```html\n \n \n ```\n\n\n\n### @input-filter\n\nAdd, update, remove pre-filter \n\n* **参数:**\n\n * `newFile: File | Object | undefined` `读写`\n * `oldFile: File | Object | undefined` `只读`\n * `prevent: Function` 调用该方法 阻止修改\n\n\n* **详细:**\n\n 如果 `newFile` 值为 `undefined` 则是删除 \n 如果 `oldFile` 值为 `undefined` 则是添加 \n 如果 `newFile`, `oldFile` 都存在则是更新\n\n > 事件内同步处理请直接修改 `newFile` \n > 事件内异步处理请使用 `update`, `add`, `remove`, `clear` 方法 \n > 异步请先设置一个错误以防止被上传\n\n > 同步不能使用 `update`, `add`, `remove`, `clear` 方法 \n > 异步不能修改 `newFile`\n\n\n* **示例:** \n ```html\n \n \n ```\n\n### @input-file\n\n添加,更新,移除 后\n\n* **参数:**\n\n * `newFile: File | Object | undefined` `只读`\n * `oldFile: File | Object | undefined` `只读`\n\n\n* **详细:**\n\n 如果 `newFile` 值为 `undefined` 则是删除 \n 如果 `oldFile` 值为 `undefined` 则是添加 \n 如果 `newFile`, `oldFile` 都存在则是更新\n\n >事件内可使用 `update`, `add`, `remove`, `clear` 方法 \n >事件内不可修改 `newFile` 对象 \n >事件内不可修改 `oldFile` 对象\n\n* **示例:**\n ```html\n \n \n ```\n\n\n\n## 实例 / 数据\n\n### features\n\n用于判断浏览器支持的特性\n\n* **类型:** `Object`\n\n* **只读:** `true`\n\n* **默认值:** `{ html5: true, directory: false, drag: false }`\n\n* **示例:**\n ```html\n \n \n 支持拖拽上传\n 支持文件夹上传\n 支持HTML5\n \n ```\n\n\n\n### active\n\n激活或停止上传\n\n* **类型:** `Boolean`\n\n* **只读:** `false`\n\n* **默认值:** `false`\n\n* **示例:**\n ```html\n \n \n 开始上传\n 停止上传\n \n ```\n\n\n\n### dropActive\n\n是否正在拖拽\n\n* **类型:** `Boolean`\n\n* **只读:** `true`\n\n* **默认值:** `false`\n\n* **示例:**\n ```html\n \n \n 拖拽到这里上传\n \n ```\n\n\n\n\n\n### uploaded\n\n是否全部已上传\n\n* **类型:** `Boolean`\n\n* **只读:** `true`\n\n* **默认值:** `true`\n\n* **示例:**\n ```html\n \n \n 全部文件已上传完毕\n \n ```\n\n\n\n\n\n## 实例 / 方法\n\n\n\n### get()\n\n使用`id`获得某个对象\n\n* **参数:**\n\n * `id: File | Object | String`\n\n\n* **结果:** `File | Object | Boolean` 存在返回文件对象否则返回 `false`\n\n\n\n### add()\n\n添加一个或多个文件\n\n* **参数:**\n\n * `files: Array | File | window.File | Object` 如果它是一个数组的响应将是一个数组\n * `index: Number | Boolean` = [`props.add-index`](#选项-属性-add-index) `true = ` 开始位置, `false = ` 结束位置, `Number = ` 下标位置\n\n\n* **结果:** `Object | Array | Boolean` 传入的是数组返回数组否则对象或`false`\n\n* **示例:**\n ```html\n \n \n ```\n\n\n### addInputFile()\n\n把``选择的文件添加进上传列表 \n\n* **参数:**\n\n * `el: HTMLInputElement` 文件元素\n\n\n* **结果:** `Array` 返回已添加的文件列表\n\n* **版本:** : `>=2.5.1`\n\n\n\n### addDataTransfer()\n\n把拖拽或者粘贴的数据的文件添加进上传列表 \n\n* **参数:**\n\n * `dataTransfer: DataTransfer` 拖拽或者粘贴的数据\n\n\n* **结果:** `Promise>` 返回已添加的文件列表\n\n\n* **版本:** : `>=2.5.1`\n\n\n\n### update()\n\n更新某个对象\n\n* **参数:**\n\n * `id: File | Object | String`\n * `data: Object` 更新的数据对象\n\n\n* **结果:** `Object | Boolean` 成功返回 `newFile` 失败返回 `false`\n\n\n* **示例:**\n ```html\n \n \n ```\n\n### remove()\n\n移除某个文件对象\n\n* **参数:**\n\n * `id: File | Object | String`\n\n\n* **结果:** `Object | Boolean` 成功返回 `oldFile` 失败返回 `false`\n\n* **示例:**\n ```html\n \n \n ```\n\n\n### replace()\n 替换两个文件的位置\n\n* **参数:**\n\n * `id1: File | Object | String`\n * `id2: File | Object | String`\n\n\n* **结果:** `Boolean`\n\n\n\n### clear()\n\n清空文件列表\n\n* **结果:** `Boolean` 总是返回 `true`\n\n\n\n## 实例 / File\n\n\n> **文件对象在`input-filter`事件外修改请使用 [`update`](#实例-方法-update) 方法**\n\n\n### fileObject\n\n* **类型:** `Boolean`\n\n* **只读:** `true`\n\n* **Required:** `true`\n\n* **默认值:** `true`\n\n* **版本:** : `>=2.6.0`\n\n* **详细:**\n\n 如果属性不存在,则不会在内部处理该对象 \n 如果属性不存在,它不是 `File` 而是 `Object`\n\n\n\n### id\n\n文件id\n\n* **类型:** `String | Number`\n\n* **只读:** `false`\n\n* **默认值:** `Math.random().toString(36).substr(2)`\n\n* **详细:**\n\n >`id` can not be repeated \n >Upload can not modify `id`\n\n\n### size\n\n文件大小\n\n* **类型:** `Number`\n\n* **只读:** `false`\n\n* **默认值:** `-1`\n\n* **浏览器:** `> IE9`\n\n\n### name\n\n文件名 \n\n* **类型:** `String`\n\n* **只读:** `false`\n\n* **默认值:** ` `\n\n* **详细:**\n\n 格式: `directory/filename.gif` `filename.gif` \n\n\n\n### type\n\nMIME类型\n\n* **类型:** `String`\n\n* **只读:** `false`\n\n* **默认值:** ` `\n\n* **浏览器:** `> IE9`\n\n* **详细:**\n\n 格式: `image/gif` `image/png` `text/html`\n\n\n\n\n### active\n\n激活或终止上传\n\n* **类型:** `Boolean`\n\n* **只读:** `false`\n\n* **默认值:** `false`\n\n* **详细:**\n\n `true` = 上传 \n `false` = 停止 \n\n\n\n\n\n\n### error\n\n上传失败错误代码\n\n* **类型:** `String`\n\n* **只读:** `false`\n\n* **默认值:** ` `\n\n* **详细:**\n\n 内置\n `size`, `extension`, `timeout`, `abort`, `network`, `server`, `denied`\n\n\n\n\n### success\n\n是否上传成功\n\n* **类型:** `Boolean`\n\n* **只读:** `false`\n\n* **默认值:** `false`\n\n\n### putAction\n\n自定义当前文件 `PUT` 地址\n\n* **类型:** `String`\n\n* **只读:** `false`\n\n* **默认值:** `this.putAction`\n\n\n\n### postAction\n\n自定义当前文件 `POST` 地址\n\n* **类型:** `String`\n\n* **只读:** `false`\n\n* **默认值:** `this.postAction`\n\n\n\n\n### headers\n\n自定义当前文件 `HTTP` Header\n\n* **类型:** `Object`\n\n* **只读:** `false`\n\n* **默认值:** `this.headers`\n\n\n### data\n\n自定义当前文件 `body` 或 `query` 附加内容\n\n* **类型:** `Object`\n\n* **只读:** `false`\n\n* **默认值:** `this.data`\n\n\n### timeout\n\n自定义当前单个文件的上传超时时间\n\n* **类型:** `Number`\n\n* **只读:** `false`\n\n* **默认值:** `this.timeout`\n\n\n### response\n\n响应的数据\n\n* **类型:** `Object | String`\n\n* **只读:** `false`\n\n* **默认值:** `{}`\n\n\n\n\n### progress\n\n上传进度\n\n* **类型:** `String`\n\n* **只读:** `false`\n\n* **默认值:** `0.00`\n\n* **浏览器:** `> IE9`\n\n\n\n### speed\n\n每秒的上传速度\n\n* **类型:** `Number`\n\n* **只读:** `true`\n\n* **默认值:** `0`\n\n* **浏览器:** `> IE9`\n\n\n\n\n### xhr\n\n`HTML5` 上传 `XMLHttpRequest` 对象\n\n* **类型:** `XMLHttpRequest`\n\n* **只读:** `true`\n\n* **默认值:** `undefined`\n\n* **浏览器:** `> IE9`\n\n\n\n\n### iframe\n\n`HTML4` 上传 `iframe` 元素\n\n* **类型:** `Element`\n\n* **只读:** `true`\n\n* **默认值:** `undefined`\n\n* **浏览器:** `= IE9`\n" /***/ }), /* 10 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_cropperjs__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_cropperjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_cropperjs__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__xkeshi_image_compressor__ = __webpack_require__(44); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__xkeshi_image_compressor___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__xkeshi_image_compressor__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_upload_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_upload_component___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_upload_component__); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { FileUpload: __WEBPACK_IMPORTED_MODULE_2_vue_upload_component___default.a }, data: function data() { return { files: [], accept: 'image/png,image/gif,image/jpeg,image/webp', extensions: 'gif,jpg,jpeg,png,webp', // extensions: ['gif', 'jpg', 'jpeg','png', 'webp'], // extensions: /\.(gif|jpe?g|png|webp)$/i, minSize: 1024, size: 1024 * 1024 * 10, multiple: true, directory: false, drop: true, dropDirectory: true, addIndex: false, thread: 3, name: 'file', postAction: '/upload/post', putAction: '/upload/put', headers: { 'X-Csrf-Token': 'xxxx' }, data: { '_csrf_token': 'xxxxxx' }, autoCompress: 1024 * 1024, uploadAuto: false, isOption: false, addData: { show: false, name: '', type: '', content: '' }, editFile: { show: false, name: '' } }; }, watch: { 'editFile.show': function editFileShow(newValue, oldValue) { // 关闭了 自动删除 error if (!newValue && oldValue) { this.$refs.upload.update(this.editFile.id, { error: this.editFile.error || '' }); } if (newValue) { this.$nextTick(function () { if (!this.$refs.editImage) { return; } var cropper = new __WEBPACK_IMPORTED_MODULE_0_cropperjs___default.a(this.$refs.editImage, { autoCrop: false }); this.editFile = _extends({}, this.editFile, { cropper: cropper }); }); } }, 'addData.show': function addDataShow(show) { if (show) { this.addData.name = ''; this.addData.type = ''; this.addData.content = ''; } } }, methods: { inputFilter: function inputFilter(newFile, oldFile, prevent) { var _this = this; if (newFile && !oldFile) { // Before adding a file // 添加文件前 // Filter system files or hide files // 过滤系统文件 和隐藏文件 if (/(\/|^)(Thumbs\.db|desktop\.ini|\..+)$/.test(newFile.name)) { return prevent(); } // Filter php html js file // 过滤 php html js 文件 if (/\.(php5?|html?|jsx?)$/i.test(newFile.name)) { return prevent(); } // Automatic compression // 自动压缩 if (newFile.file && newFile.type.substr(0, 6) === 'image/' && this.autoCompress > 0 && this.autoCompress < newFile.size) { newFile.error = 'compressing'; var imageCompressor = new __WEBPACK_IMPORTED_MODULE_1__xkeshi_image_compressor___default.a(null, { convertSize: Infinity, maxWidth: 512, maxHeight: 512 }); imageCompressor.compress(newFile.file).then(function (file) { _this.$refs.upload.update(newFile, { error: '', file: file, size: file.size, type: file.type }); }).catch(function (err) { _this.$refs.upload.update(newFile, { error: err.message || 'compress' }); }); } } if (newFile && (!oldFile || newFile.file !== oldFile.file)) { // Create a blob field // 创建 blob 字段 newFile.blob = ''; var URL = window.URL || window.webkitURL; if (URL && URL.createObjectURL) { newFile.blob = URL.createObjectURL(newFile.file); } // Thumbnails // 缩略图 newFile.thumb = ''; if (newFile.blob && newFile.type.substr(0, 6) === 'image/') { newFile.thumb = newFile.blob; } } }, // add, update, remove File Event inputFile: function inputFile(newFile, oldFile) { if (newFile && oldFile) { // update if (newFile.active && !oldFile.active) { // beforeSend // min size if (newFile.size >= 0 && this.minSize > 0 && newFile.size < this.minSize) { this.$refs.upload.update(newFile, { error: 'size' }); } } if (newFile.progress !== oldFile.progress) { // progress } if (newFile.error && !oldFile.error) { // error } if (newFile.success && !oldFile.success) { // success } } if (!newFile && oldFile) { // remove if (oldFile.success && oldFile.response.id) { // $.ajax({ // type: 'DELETE', // url: '/upload/delete?id=' + oldFile.response.id, // }) } } // Automatically activate upload if (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error) { if (this.uploadAuto && !this.$refs.upload.active) { this.$refs.upload.active = true; } } }, alert: function (_alert) { function alert(_x) { return _alert.apply(this, arguments); } alert.toString = function () { return _alert.toString(); }; return alert; }(function (message) { alert(message); }), onEditFileShow: function onEditFileShow(file) { this.editFile = _extends({}, file, { show: true }); this.$refs.upload.update(file, { error: 'edit' }); }, onEditorFile: function onEditorFile() { if (!this.$refs.upload.features.html5) { this.alert('Your browser does not support'); this.editFile.show = false; return; } var data = { name: this.editFile.name }; if (this.editFile.cropper) { var binStr = atob(this.editFile.cropper.getCroppedCanvas().toDataURL(this.editFile.type).split(',')[1]); var arr = new Uint8Array(binStr.length); for (var i = 0; i < binStr.length; i++) { arr[i] = binStr.charCodeAt(i); } data.file = new File([arr], data.name, { type: this.editFile.type }); data.size = data.file.size; } this.$refs.upload.update(this.editFile.id, data); this.editFile.error = ''; this.editFile.show = false; }, // add folader onAddFolader: function onAddFolader() { var _this2 = this; if (!this.$refs.upload.features.directory) { this.alert('Your browser does not support'); return; } var input = this.$refs.upload.$el.querySelector('input'); input.directory = true; input.webkitdirectory = true; this.directory = true; input.onclick = null; input.click(); input.onclick = function (e) { _this2.directory = false; input.directory = false; input.webkitdirectory = false; }; }, onAddData: function onAddData() { this.addData.show = false; if (!this.$refs.upload.features.html5) { this.alert('Your browser does not support'); return; } var file = new window.File([this.addData.content], this.addData.name, { type: this.addData.type }); this.$refs.upload.add(file); } } }); /***/ }), /* 11 */ /***/ (function(module, exports) { module.exports = Cropper; /***/ }), /* 12 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__chunk_ChunkUploadHandler__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__InputFile_vue__ = __webpack_require__(50); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // var CHUNK_DEFAULT_OPTIONS = { headers: { 'Content-Type': 'application/json' }, action: '', minSize: 1048576, maxActive: 3, maxRetries: 5, handler: __WEBPACK_IMPORTED_MODULE_0__chunk_ChunkUploadHandler__["a" /* default */] }; /* harmony default export */ __webpack_exports__["a"] = ({ components: { InputFile: __WEBPACK_IMPORTED_MODULE_1__InputFile_vue__["a" /* default */] }, props: { inputId: { type: String }, name: { type: String, default: 'file' }, accept: { type: String }, capture: {}, multiple: { type: Boolean }, maximum: { type: Number, default: function _default() { return this.multiple ? 0 : 1; } }, addIndex: { type: [Boolean, Number] }, directory: { type: Boolean }, postAction: { type: String }, putAction: { type: String }, customAction: { type: Function }, headers: { type: Object, default: Object }, data: { type: Object, default: Object }, timeout: { type: Number, default: 0 }, drop: { default: false }, dropDirectory: { type: Boolean, default: true }, size: { type: Number, default: 0 }, extensions: { default: Array }, value: { type: Array, default: Array }, thread: { type: Number, default: 1 }, // Chunk upload enabled chunkEnabled: { type: Boolean, default: false }, // Chunk upload properties chunk: { type: Object, default: function _default() { return CHUNK_DEFAULT_OPTIONS; } } }, data: function data() { return { files: this.value, features: { html5: true, directory: false, drag: false }, active: false, dropActive: false, uploading: 0, destroy: false }; }, /** * mounted * @return {[type]} [description] */ mounted: function mounted() { var input = document.createElement('input'); input.type = 'file'; input.multiple = true; // html5 特征 if (window.FormData && input.files) { // 上传目录特征 if (typeof input.webkitdirectory === 'boolean' || typeof input.directory === 'boolean') { this.features.directory = true; } // 拖拽特征 if (this.features.html5 && typeof input.ondrop !== 'undefined') { this.features.drop = true; } } else { this.features.html5 = false; } // files 定位缓存 this.maps = {}; this.$nextTick(function () { // 更新下父级 if (this.$parent) { this.$parent.$forceUpdate(); } // 拖拽渲染 this.watchDrop(this.drop); }); }, /** * beforeDestroy * @return {[type]} [description] */ beforeDestroy: function beforeDestroy() { // 已销毁 this.destroy = true; // 设置成不激活 this.active = false; }, computed: { /** * uploading 正在上传的线程 * @return {[type]} [description] */ /** * uploaded 文件列表是否全部已上传 * @return {[type]} [description] */ uploaded: function uploaded() { var file = void 0; for (var i = 0; i < this.files.length; i++) { file = this.files[i]; if (file.fileObject && !file.error && !file.success) { return false; } } return true; }, chunkOptions: function chunkOptions() { return Object.assign(CHUNK_DEFAULT_OPTIONS, this.chunk); }, className: function className() { return ['file-uploads', this.features.html5 ? 'file-uploads-html5' : 'file-uploads-html4', this.features.directory && this.directory ? 'file-uploads-directory' : undefined, this.features.drop && this.drop ? 'file-uploads-drop' : undefined]; } }, watch: { active: function active(_active) { this.watchActive(_active); }, dropActive: function dropActive() { if (this.$parent) { this.$parent.$forceUpdate(); } }, drop: function drop(value) { this.watchDrop(value); }, value: function value(files) { if (this.files === files) { return; } this.files = files; var oldMaps = this.maps; // 重写 maps 缓存 this.maps = {}; for (var i = 0; i < this.files.length; i++) { var file = this.files[i]; this.maps[file.id] = file; } // add, update for (var key in this.maps) { var newFile = this.maps[key]; var oldFile = oldMaps[key]; if (newFile !== oldFile) { this.emitFile(newFile, oldFile); } } // delete for (var _key in oldMaps) { if (!this.maps[_key]) { this.emitFile(undefined, oldMaps[_key]); } } } }, methods: { // 清空 clear: function clear() { if (this.files.length) { var files = this.files; this.files = []; // 定位 this.maps = {}; // 事件 this.emitInput(); for (var i = 0; i < files.length; i++) { this.emitFile(undefined, files[i]); } } return true; }, // 选择 get: function get(id) { if (!id) { return false; } if ((typeof id === 'undefined' ? 'undefined' : _typeof(id)) === 'object') { return this.maps[id.id] || false; } return this.maps[id] || false; }, // 添加 add: function add(_files) { var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.addIndex; var files = _files; var isArray = files instanceof Array; // 不是数组整理成数组 if (!isArray) { files = [files]; } // 遍历规范对象 var addFiles = []; for (var i = 0; i < files.length; i++) { var file = files[i]; if (this.features.html5 && file instanceof Blob) { file = { file: file, size: file.size, name: file.webkitRelativePath || file.relativePath || file.name || 'unknown', type: file.type }; } var fileObject = false; if (file.fileObject === false) { // false } else if (file.fileObject) { fileObject = true; } else if (typeof Element !== 'undefined' && file.el instanceof Element) { fileObject = true; } else if (typeof Blob !== 'undefined' && file.file instanceof Blob) { fileObject = true; } if (fileObject) { file = _extends({ fileObject: true, size: -1, name: 'Filename', type: '', active: false, error: '', success: false, putAction: this.putAction, postAction: this.postAction, timeout: this.timeout }, file, { response: {}, progress: '0.00', // 只读 speed: 0 // 只读 // xhr: false, // 只读 // iframe: false, // 只读 }); file.data = _extends({}, this.data, file.data ? file.data : {}); file.headers = _extends({}, this.headers, file.headers ? file.headers : {}); } // 必须包含 id if (!file.id) { file.id = Math.random().toString(36).substr(2); } if (this.emitFilter(file, undefined)) { continue; } // 最大数量限制 if (this.maximum > 1 && addFiles.length + this.files.length >= this.maximum) { break; } addFiles.push(file); // 最大数量限制 if (this.maximum === 1) { break; } } // 没有文件 if (!addFiles.length) { return false; } // 如果是 1 清空 if (this.maximum === 1) { this.clear(); } // 添加进去 files var newFiles = void 0; if (index === true || index === 0) { newFiles = addFiles.concat(this.files); } else if (index) { newFiles = addFiles.concat([]); newFiles.splice(index, 0, addFiles); } else { newFiles = this.files.concat(addFiles); } this.files = newFiles; // 定位 for (var _i = 0; _i < addFiles.length; _i++) { var _file2 = addFiles[_i]; this.maps[_file2.id] = _file2; } // 事件 this.emitInput(); for (var _i2 = 0; _i2 < addFiles.length; _i2++) { this.emitFile(addFiles[_i2], undefined); } return isArray ? addFiles : addFiles[0]; }, // 添加表单文件 addInputFile: function addInputFile(el) { var files = []; if (el.files) { for (var i = 0; i < el.files.length; i++) { var file = el.files[i]; files.push({ size: file.size, name: file.webkitRelativePath || file.relativePath || file.name, type: file.type, file: file, el: el }); } } else { files.push({ name: el.value.replace(/^.*?([^\/\\\r\n]+)$/, '$1'), el: el }); } return this.add(files); }, // 添加 DataTransfer addDataTransfer: function addDataTransfer(dataTransfer) { var _this = this; var files = []; if (dataTransfer.items && dataTransfer.items.length) { var items = []; for (var i = 0; i < dataTransfer.items.length; i++) { var item = dataTransfer.items[i]; if (item.getAsEntry) { item = item.getAsEntry() || item.getAsFile(); } else if (item.webkitGetAsEntry) { item = item.webkitGetAsEntry() || item.getAsFile(); } else { item = item.getAsFile(); } if (item) { items.push(item); } } return new Promise(function (resolve, reject) { var forEach = function forEach(i) { var item = items[i]; // 结束 文件数量大于 最大数量 if (!item || _this.maximum > 0 && files.length >= _this.maximum) { return resolve(_this.add(files)); } _this.getEntry(item).then(function (results) { files.push.apply(files, _toConsumableArray(results)); forEach(i + 1); }); }; forEach(0); }); } if (dataTransfer.files.length) { for (var _i3 = 0; _i3 < dataTransfer.files.length; _i3++) { files.push(dataTransfer.files[_i3]); if (this.maximum > 0 && files.length >= this.maximum) { break; } } return Promise.resolve(this.add(files)); } return Promise.resolve([]); }, // 获得 entry getEntry: function getEntry(entry) { var _this2 = this; var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return new Promise(function (resolve, reject) { if (entry.isFile) { entry.file(function (file) { resolve([{ size: file.size, name: path + file.name, type: file.type, file: file }]); }); } else if (entry.isDirectory && _this2.dropDirectory) { var files = []; var dirReader = entry.createReader(); var readEntries = function readEntries() { dirReader.readEntries(function (entries) { var forEach = function forEach(i) { if (!entries[i] && i === 0 || _this2.maximum > 0 && files.length >= _this2.maximum) { return resolve(files); } if (!entries[i]) { return readEntries(); } _this2.getEntry(entries[i], path + entry.name + '/').then(function (results) { files.push.apply(files, _toConsumableArray(results)); forEach(i + 1); }); }; forEach(0); }); }; readEntries(); } else { resolve([]); } }); }, replace: function replace(id1, id2) { var file1 = this.get(id1); var file2 = this.get(id2); if (!file1 || !file2 || file1 === file2) { return false; } var files = this.files.concat([]); var index1 = files.indexOf(file1); var index2 = files.indexOf(file2); if (index1 === -1 || index2 === -1) { return false; } files[index1] = file2; files[index2] = file1; this.files = files; this.emitInput(); return true; }, // 移除 remove: function remove(id) { var file = this.get(id); if (file) { if (this.emitFilter(undefined, file)) { return false; } var files = this.files.concat([]); var index = files.indexOf(file); if (index === -1) { console.error('remove', file); return false; } files.splice(index, 1); this.files = files; // 定位 delete this.maps[file.id]; // 事件 this.emitInput(); this.emitFile(undefined, file); } return file; }, // 更新 update: function update(id, data) { var file = this.get(id); if (file) { var newFile = _extends({}, file, data); // 停用必须加上错误 if (file.fileObject && file.active && !newFile.active && !newFile.error && !newFile.success) { newFile.error = 'abort'; } if (this.emitFilter(newFile, file)) { return false; } var files = this.files.concat([]); var index = files.indexOf(file); if (index === -1) { console.error('update', file); return false; } files.splice(index, 1, newFile); this.files = files; // 删除 旧定位 写入 新定位 (已便支持修改id) delete this.maps[file.id]; this.maps[newFile.id] = newFile; // 事件 this.emitInput(); this.emitFile(newFile, file); return newFile; } return false; }, // 预处理 事件 过滤器 emitFilter: function emitFilter(newFile, oldFile) { var isPrevent = false; this.$emit('input-filter', newFile, oldFile, function () { isPrevent = true; return isPrevent; }); return isPrevent; }, // 处理后 事件 分发 emitFile: function emitFile(newFile, oldFile) { this.$emit('input-file', newFile, oldFile); if (newFile && newFile.fileObject && newFile.active && (!oldFile || !oldFile.active)) { this.uploading++; // 激活 this.$nextTick(function () { var _this3 = this; setTimeout(function () { _this3.upload(newFile).then(function () { // eslint-disable-next-line newFile = _this3.get(newFile); if (newFile && newFile.fileObject) { _this3.update(newFile, { active: false, success: !newFile.error }); } }).catch(function (e) { _this3.update(newFile, { active: false, success: false, error: e.code || e.error || e.message || e }); }); }, parseInt(Math.random() * 50 + 50, 10)); }); } else if ((!newFile || !newFile.fileObject || !newFile.active) && oldFile && oldFile.fileObject && oldFile.active) { // 停止 this.uploading--; } // 自动延续激活 if (this.active && (Boolean(newFile) !== Boolean(oldFile) || newFile.active !== oldFile.active)) { this.watchActive(true); } }, emitInput: function emitInput() { this.$emit('input', this.files); }, // 上传 upload: function upload(id) { var file = this.get(id); // 被删除 if (!file) { return Promise.reject('not_exists'); } // 不是文件对象 if (!file.fileObject) { return Promise.reject('file_object'); } // 有错误直接响应 if (file.error) { return Promise.reject(file.error); } // 已完成直接响应 if (file.success) { return Promise.resolve(file); } // 后缀 var extensions = this.extensions; if (extensions && (extensions.length || typeof extensions.length === 'undefined')) { if ((typeof extensions === 'undefined' ? 'undefined' : _typeof(extensions)) !== 'object' || !(extensions instanceof RegExp)) { if (typeof extensions === 'string') { extensions = extensions.split(',').map(function (value) { return value.trim(); }).filter(function (value) { return value; }); } extensions = new RegExp('\\.(' + extensions.join('|').replace(/\./g, '\\.') + ')$', 'i'); } if (file.name.search(extensions) === -1) { return Promise.reject('extension'); } } // 大小 if (this.size > 0 && file.size >= 0 && file.size > this.size) { return Promise.reject('size'); } if (this.customAction) { return this.customAction(file, this); } if (this.features.html5) { if (this.shouldUseChunkUpload(file)) { return this.uploadChunk(file); } if (file.putAction) { return this.uploadPut(file); } if (file.postAction) { return this.uploadHtml5(file); } } if (file.postAction) { return this.uploadHtml4(file); } return Promise.reject('No action configured'); }, /** * Whether this file should be uploaded using chunk upload or not * * @param Object file */ shouldUseChunkUpload: function shouldUseChunkUpload(file) { return this.chunkEnabled && !!this.chunkOptions.handler && file.size > this.chunkOptions.minSize; }, /** * Upload a file using Chunk method * * @param File file */ uploadChunk: function uploadChunk(file) { var HandlerClass = this.chunkOptions.handler; file.chunk = new HandlerClass(file, this.chunkOptions); return file.chunk.upload(); }, uploadPut: function uploadPut(file) { var querys = []; var value = void 0; for (var key in file.data) { value = file.data[key]; if (value !== null && value !== undefined) { querys.push(encodeURIComponent(key) + '=' + encodeURIComponent(value)); } } var queryString = querys.length ? (file.putAction.indexOf('?') === -1 ? '?' : '&') + querys.join('&') : ''; var xhr = new XMLHttpRequest(); xhr.open('PUT', file.putAction + queryString); return this.uploadXhr(xhr, file, file.file); }, uploadHtml5: function uploadHtml5(file) { var form = new window.FormData(); var value = void 0; for (var key in file.data) { value = file.data[key]; if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && typeof value.toString !== 'function') { if (value instanceof File) { form.append(key, value, value.name); } else { form.append(key, JSON.stringify(value)); } } else if (value !== null && value !== undefined) { form.append(key, value); } } form.append(this.name, file.file, file.file.filename || file.name); var xhr = new XMLHttpRequest(); xhr.open('POST', file.postAction); return this.uploadXhr(xhr, file, form); }, uploadXhr: function uploadXhr(xhr, _file, body) { var _this4 = this; var file = _file; var speedTime = 0; var speedLoaded = 0; // 进度条 xhr.upload.onprogress = function (e) { // 还未开始上传 已删除 未激活 file = _this4.get(file); if (!e.lengthComputable || !file || !file.fileObject || !file.active) { return; } // 进度 速度 每秒更新一次 var speedTime2 = Math.round(Date.now() / 1000); if (speedTime2 === speedTime) { return; } speedTime = speedTime2; file = _this4.update(file, { progress: (e.loaded / e.total * 100).toFixed(2), speed: e.loaded - speedLoaded }); speedLoaded = e.loaded; }; // 检查激活状态 var interval = setInterval(function () { file = _this4.get(file); if (file && file.fileObject && !file.success && !file.error && file.active) { return; } if (interval) { clearInterval(interval); interval = false; } try { xhr.abort(); xhr.timeout = 1; } catch (e) {} }, 100); return new Promise(function (resolve, reject) { var complete = void 0; var fn = function fn(e) { // 已经处理过了 if (complete) { return; } complete = true; if (interval) { clearInterval(interval); interval = false; } file = _this4.get(file); // 不存在直接响应 if (!file) { return reject('not_exists'); } // 不是文件对象 if (!file.fileObject) { return reject('file_object'); } // 有错误自动响应 if (file.error) { return reject(file.error); } // 未激活 if (!file.active) { return reject('abort'); } // 已完成 直接相应 if (file.success) { return resolve(file); } var data = {}; switch (e.type) { case 'timeout': case 'abort': data.error = e.type; break; case 'error': if (!xhr.status) { data.error = 'network'; } else if (xhr.status >= 500) { data.error = 'server'; } else if (xhr.status >= 400) { data.error = 'denied'; } break; default: if (xhr.status >= 500) { data.error = 'server'; } else if (xhr.status >= 400) { data.error = 'denied'; } else { data.progress = '100.00'; } } if (xhr.responseText) { var contentType = xhr.getResponseHeader('Content-Type'); if (contentType && contentType.indexOf('/json') !== -1) { data.response = JSON.parse(xhr.responseText); } else { data.response = xhr.responseText; } } // 更新 file = _this4.update(file, data); // 相应错误 if (file.error) { return reject(file.error); } // 响应 return resolve(file); }; // 事件 xhr.onload = fn; xhr.onerror = fn; xhr.onabort = fn; xhr.ontimeout = fn; // 超时 if (file.timeout) { xhr.timeout = file.timeout; } // headers for (var key in file.headers) { xhr.setRequestHeader(key, file.headers[key]); } // 更新 xhr file = _this4.update(file, { xhr: xhr }); // 开始上传 xhr.send(body); }); }, uploadHtml4: function uploadHtml4(_file) { var _this5 = this; var file = _file; var onKeydown = function onKeydown(e) { if (e.keyCode === 27) { e.preventDefault(); } }; var iframe = document.createElement('iframe'); iframe.id = 'upload-iframe-' + file.id; iframe.name = 'upload-iframe-' + file.id; iframe.src = 'about:blank'; iframe.setAttribute('style', 'width:1px;height:1px;top:-999em;position:absolute; margin-top:-999em;'); var form = document.createElement('form'); form.action = file.postAction; form.name = 'upload-form-' + file.id; form.setAttribute('method', 'POST'); form.setAttribute('target', 'upload-iframe-' + file.id); form.setAttribute('enctype', 'multipart/form-data'); var value = void 0; var input = void 0; for (var key in file.data) { value = file.data[key]; if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && typeof value.toString !== 'function') { value = JSON.stringify(value); } if (value !== null && value !== undefined) { input = document.createElement('input'); input.type = 'hidden'; input.name = key; input.value = value; form.appendChild(input); } } form.appendChild(file.el); document.body.appendChild(iframe).appendChild(form); var getResponseData = function getResponseData() { var doc = void 0; try { if (iframe.contentWindow) { doc = iframe.contentWindow.document; } } catch (err) {} if (!doc) { try { doc = iframe.contentDocument ? iframe.contentDocument : iframe.document; } catch (err) { doc = iframe.document; } } if (doc && doc.body) { return doc.body.innerHTML; } return null; }; return new Promise(function (resolve, reject) { setTimeout(function () { file = _this5.update(file, { iframe: iframe }); // 不存在 if (!file) { return reject('not_exists'); } // 定时检查 var interval = setInterval(function () { file = _this5.get(file); if (file && file.fileObject && !file.success && !file.error && file.active) { return; } if (interval) { clearInterval(interval); interval = false; } iframe.onabort({ type: file ? 'abort' : 'not_exists' }); }, 100); var complete = void 0; var fn = function fn(e) { // 已经处理过了 if (complete) { return; } complete = true; if (interval) { clearInterval(interval); interval = false; } // 关闭 esc 事件 document.body.removeEventListener('keydown', onKeydown); file = _this5.get(file); // 不存在直接响应 if (!file) { return reject('not_exists'); } // 不是文件对象 if (!file.fileObject) { return reject('file_object'); } // 有错误自动响应 if (file.error) { return reject(file.error); } // 未激活 if (!file.active) { return reject('abort'); } // 已完成 直接相应 if (file.success) { return resolve(file); } var response = getResponseData(); var data = {}; switch (e.type) { case 'abort': data.error = 'abort'; break; case 'error': if (file.error) { data.error = file.error; } else if (response === null) { data.error = 'network'; } else { data.error = 'denied'; } break; default: if (file.error) { data.error = file.error; } else if (data === null) { data.error = 'network'; } else { data.progress = '100.00'; } } if (response !== null) { if (response && response.substr(0, 1) === '{' && response.substr(response.length - 1, 1) === '}') { try { response = JSON.parse(response); } catch (err) {} } data.response = response; } // 更新 file = _this5.update(file, data); if (file.error) { return reject(file.error); } // 响应 return resolve(file); }; // 添加事件 iframe.onload = fn; iframe.onerror = fn; iframe.onabort = fn; // 禁止 esc 键 document.body.addEventListener('keydown', onKeydown); // 提交 form.submit(); }, 50); }).then(function (res) { iframe.parentNode && iframe.parentNode.removeChild(iframe); return res; }).catch(function (res) { iframe.parentNode && iframe.parentNode.removeChild(iframe); return res; }); }, watchActive: function watchActive(active) { var file = void 0; var index = 0; while (file = this.files[index]) { index++; if (!file.fileObject) { // 不是文件对象 } else if (active && !this.destroy) { if (this.uploading >= this.thread || this.uploading && !this.features.html5) { break; } if (!file.active && !file.error && !file.success) { this.update(file, { active: true }); } } else { if (file.active) { this.update(file, { active: false }); } } } if (this.uploading === 0) { this.active = false; } }, watchDrop: function watchDrop(_el) { var el = _el; if (!this.features.drop) { return; } // 移除挂载 if (this.dropElement) { try { document.removeEventListener('dragenter', this.onDragenter, false); document.removeEventListener('dragleave', this.onDragleave, false); document.removeEventListener('drop', this.onDocumentDrop, false); this.dropElement.removeEventListener('dragover', this.onDragover, false); this.dropElement.removeEventListener('drop', this.onDrop, false); } catch (e) {} } if (!el) { el = false; } else if (typeof el === 'string') { el = document.querySelector(el) || this.$root.$el.querySelector(el); } else if (el === true) { el = this.$parent.$el; } this.dropElement = el; if (this.dropElement) { document.addEventListener('dragenter', this.onDragenter, false); document.addEventListener('dragleave', this.onDragleave, false); document.addEventListener('drop', this.onDocumentDrop, false); this.dropElement.addEventListener('dragover', this.onDragover, false); this.dropElement.addEventListener('drop', this.onDrop, false); } }, onDragenter: function onDragenter(e) { e.preventDefault(); if (!this.dropActive) { this.dropActive = true; } }, onDragleave: function onDragleave(e) { e.preventDefault(); if (e.target.nodeName === 'HTML' || e.screenX === 0 && e.screenY === 0 && !e.fromElement && e.offsetX <= 0) { this.dropActive = false; } }, onDragover: function onDragover(e) { e.preventDefault(); }, onDocumentDrop: function onDocumentDrop() { this.dropActive = false; }, onDrop: function onDrop(e) { e.preventDefault(); this.addDataTransfer(e.dataTransfer); } } }); /***/ }), /* 13 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ methods: { change: function change(e) { this.$destroy(); this.$parent.addInputFile(e.target); // eslint-disable-next-line new this.constructor({ parent: this.$parent, el: this.$el }); } } }); /***/ }), /* 14 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_upload_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_upload_component___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_upload_component__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { FileUpload: __WEBPACK_IMPORTED_MODULE_0_vue_upload_component___default.a }, data: function data() { return { files: [] }; }, methods: { inputFilter: function inputFilter(newFile, oldFile, prevent) { if (newFile && !oldFile) { // Before adding a file // 添加文件前 // Filter system files or hide files // 过滤系统文件 和隐藏文件 if (/(\/|^)(Thumbs\.db|desktop\.ini|\..+)$/.test(newFile.name)) { return prevent(); } // Filter php html js file // 过滤 php html js 文件 if (/\.(php5?|html?|jsx?)$/i.test(newFile.name)) { return prevent(); } } }, inputFile: function inputFile(newFile, oldFile) { if (newFile && !oldFile) { // add console.log('add', newFile); } if (newFile && oldFile) { // update console.log('update', newFile); } if (!newFile && oldFile) { // remove console.log('remove', oldFile); } } } }); /***/ }), /* 15 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_cropperjs__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_cropperjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_cropperjs__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_upload_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_upload_component___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_upload_component__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { FileUpload: __WEBPACK_IMPORTED_MODULE_1_vue_upload_component___default.a }, data: function data() { return { files: [], edit: false, cropper: false }; }, watch: { edit: function edit(value) { if (value) { this.$nextTick(function () { if (!this.$refs.editImage) { return; } var cropper = new __WEBPACK_IMPORTED_MODULE_0_cropperjs___default.a(this.$refs.editImage, { aspectRatio: 1 / 1, viewMode: 1 }); this.cropper = cropper; }); } else { if (this.cropper) { this.cropper.destroy(); this.cropper = false; } } } }, methods: { editSave: function editSave() { this.edit = false; var oldFile = this.files[0]; var binStr = atob(this.cropper.getCroppedCanvas().toDataURL(oldFile.type).split(',')[1]); var arr = new Uint8Array(binStr.length); for (var i = 0; i < binStr.length; i++) { arr[i] = binStr.charCodeAt(i); } var file = new File([arr], oldFile.name, { type: oldFile.type }); this.$refs.upload.update(oldFile.id, { file: file, type: file.type, size: file.size, active: true }); }, alert: function (_alert) { function alert(_x) { return _alert.apply(this, arguments); } alert.toString = function () { return _alert.toString(); }; return alert; }(function (message) { alert(message); }), inputFile: function inputFile(newFile, oldFile, prevent) { if (newFile && !oldFile) { this.$nextTick(function () { this.edit = true; }); } if (!newFile && oldFile) { this.edit = false; } }, inputFilter: function inputFilter(newFile, oldFile, prevent) { if (newFile && !oldFile) { if (!/\.(gif|jpg|jpeg|png|webp)$/i.test(newFile.name)) { this.alert('Your choice is not a picture'); return prevent(); } } if (newFile && (!oldFile || newFile.file !== oldFile.file)) { newFile.url = ''; var URL = window.URL || window.webkitURL; if (URL && URL.createObjectURL) { newFile.url = URL.createObjectURL(newFile.file); } } } } }); /***/ }), /* 16 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_upload_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_upload_component___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_upload_component__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { FileUpload: __WEBPACK_IMPORTED_MODULE_0_vue_upload_component___default.a }, data: function data() { return { files: [] }; } }); /***/ }), /* 17 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_upload_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_upload_component___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_upload_component__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { FileUpload: __WEBPACK_IMPORTED_MODULE_0_vue_upload_component___default.a }, data: function data() { return { files1: [], files2: [] }; } }); /***/ }), /* 18 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_upload_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_upload_component___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_upload_component__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { FileUpload: __WEBPACK_IMPORTED_MODULE_0_vue_upload_component___default.a }, data: function data() { return { files: [], chunkEnabled: true, // 1MB by default chunkMinSize: 1, chunkMaxActive: 3, chunkMaxRetries: 5 }; }, methods: { inputFilter: function inputFilter(newFile, oldFile, prevent) { if (newFile && !oldFile) { // Before adding a file // 添加文件前 // Filter system files or hide files // 过滤系统文件 和隐藏文件 if (/(\/|^)(Thumbs\.db|desktop\.ini|\..+)$/.test(newFile.name)) { return prevent(); } // Filter php html js file // 过滤 php html js 文件 if (/\.(php5?|html?|jsx?)$/i.test(newFile.name)) { return prevent(); } } }, inputFile: function inputFile(newFile, oldFile) { if (newFile && !oldFile) { // add console.log('add', newFile); this.$refs.upload.active = true; } if (newFile && oldFile) { // update console.log('update', newFile); } if (!newFile && oldFile) { // remove console.log('remove', oldFile); } } } }); /***/ }), /* 19 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vuex__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vuex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vuex__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_upload_component__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_upload_component___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_upload_component__); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { FileUpload: __WEBPACK_IMPORTED_MODULE_1_vue_upload_component___default.a }, computed: _extends({}, Object(__WEBPACK_IMPORTED_MODULE_0_vuex__["mapState"])(['files'])), methods: { inputUpdate: function inputUpdate(files) { this.$store.commit('updateFiles', files); } } }); /***/ }), /* 20 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ data: function data() { return { showLocale: false, showNav: false }; }, beforeCreate: function beforeCreate() { if (this.$route.params.locale && this.$route.params.locale !== this.$i18n.locale) { this.$i18n.locale = this.$route.params.locale; } }, beforeUpdate: function beforeUpdate() { if (this.$route.params.locale && this.$route.params.locale !== this.$i18n.locale) { this.$i18n.locale = this.$route.params.locale; } }, computed: { locale: function locale() { var i18n = this.$i18n; return i18n.messages[i18n.locale].locale; } }, methods: { onLocale: function onLocale(show) { var _this = this; if (show) { this.showLocale = show; } else { setTimeout(function () { _this.showLocale = show; }, 128); } } } }); /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(22); /***/ }), /* 22 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(23); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_marked__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_marked___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_marked__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_highlight_js__ = __webpack_require__(24); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_highlight_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_highlight_js__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__store__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__router__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__i18n__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__views_App__ = __webpack_require__(80); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } __WEBPACK_IMPORTED_MODULE_0_vue___default.a.config.silent = false; __WEBPACK_IMPORTED_MODULE_0_vue___default.a.config.devtools = true; var Renderer = function (_marked$Renderer) { _inherits(Renderer, _marked$Renderer); function Renderer() { _classCallCheck(this, Renderer); return _possibleConstructorReturn(this, (Renderer.__proto__ || Object.getPrototypeOf(Renderer)).apply(this, arguments)); } _createClass(Renderer, [{ key: 'heading', value: function heading(text, level, raw) { var rawName = raw.toLowerCase().replace(/([\u0000-\u002F\u003A-\u0060\u007B-\u007F]+)/g, '-').replace(/^\-+|\-+$/, ''); if (!this.options.headers) { this.options.headers = []; } while (this.options.headers.length >= level) { this.options.headers.pop(); } var parent = this.options.headers.filter(function (value) { return !!value; }).join('-'); if (parent) { parent = parent + '-'; } while (this.options.headers.length < level - 1) { this.options.headers.push(''); } this.options.headers.push(rawName); return '' + text + '\n'; } }]); return Renderer; }(__WEBPACK_IMPORTED_MODULE_1_marked___default.a.Renderer); __WEBPACK_IMPORTED_MODULE_1_marked___default.a.setOptions({ renderer: new Renderer(), gfm: true, tables: true, breaks: false, pedantic: false, sanitize: false, smartLists: true, smartypants: false, highlight: function highlight(code, lang) { if (lang) { return __WEBPACK_IMPORTED_MODULE_2_highlight_js___default.a.highlight(lang, code).value; } else { return __WEBPACK_IMPORTED_MODULE_2_highlight_js___default.a.highlightAuto(code).value; } } }); __WEBPACK_IMPORTED_MODULE_0_vue___default.a.directive('markdown', function (el, binding, vnode) { if (!el.className || !/vue-markdown/.test(el.className)) { el.className += ' vue-markdown'; } var text = ''; for (var i = 0; i < vnode.children.length; i++) { text += vnode.children[i].text || ''; } if (el.markdown === text) { return; } el.markdown = text; el.innerHTML = __WEBPACK_IMPORTED_MODULE_1_marked___default()(text); var selectorList = el.querySelectorAll('a'); for (var _i = 0; _i < selectorList.length; _i++) { selectorList[_i].onclick = function (e) { if (e.metaKey || e.ctrlKey || e.shiftKey) { return; } if (e.defaultPrevented) { return; } if (e.button !== undefined && e.button !== 0) { return; } if (this.host !== window.location.host) { return; } var href = this.getAttribute('href'); if (!href) { return; } if (href.charAt(0) !== '#') { return; } e.preventDefault(); __WEBPACK_IMPORTED_MODULE_4__router__["a" /* default */].push(href); }; } }); __WEBPACK_IMPORTED_MODULE_0_vue___default.a.filter('formatSize', function (size) { if (size > 1024 * 1024 * 1024 * 1024) { return (size / 1024 / 1024 / 1024 / 1024).toFixed(2) + ' TB'; } else if (size > 1024 * 1024 * 1024) { return (size / 1024 / 1024 / 1024).toFixed(2) + ' GB'; } else if (size > 1024 * 1024) { return (size / 1024 / 1024).toFixed(2) + ' MB'; } else if (size > 1024) { return (size / 1024).toFixed(2) + ' KB'; } return size.toString() + ' B'; }); __WEBPACK_IMPORTED_MODULE_0_vue___default.a.filter('toLocale', function (to) { return '/' + __WEBPACK_IMPORTED_MODULE_5__i18n__["a" /* default */].locale + to; }); new __WEBPACK_IMPORTED_MODULE_0_vue___default.a(_extends({ store: __WEBPACK_IMPORTED_MODULE_3__store__["a" /* default */], router: __WEBPACK_IMPORTED_MODULE_4__router__["a" /* default */], i18n: __WEBPACK_IMPORTED_MODULE_5__i18n__["a" /* default */] }, __WEBPACK_IMPORTED_MODULE_6__views_App__["a" /* default */])).$mount('#app'); /***/ }), /* 23 */ /***/ (function(module, exports) { module.exports = Vue; /***/ }), /* 24 */ /***/ (function(module, exports) { module.exports = hljs; /***/ }), /* 25 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vuex__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vuex___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vuex__); // import Vue from 'vue' // // Vue.use(Vuex) var state = { files: [] }; var mutations = { updateFiles: function updateFiles(state, files) { state.files = files; } }; /* harmony default export */ __webpack_exports__["a"] = (new __WEBPACK_IMPORTED_MODULE_0_vuex___default.a.Store({ strict: true, state: state, mutations: mutations })); /***/ }), /* 26 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_router__ = __webpack_require__(27); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_router___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_router__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__i18n__ = __webpack_require__(6); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__views_Router__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__views_Document__ = __webpack_require__(33); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__views_Example__ = __webpack_require__(39); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__views_examples_Full__ = __webpack_require__(41); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__views_examples_Simple__ = __webpack_require__(54); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__views_examples_Avatar__ = __webpack_require__(58); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__views_examples_Drag__ = __webpack_require__(62); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__views_examples_Multiple__ = __webpack_require__(66); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__views_examples_Chunk__ = __webpack_require__(70); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__views_examples_Vuex__ = __webpack_require__(76); // import Vue from 'vue' // Vue.use(VueRouter) var examples = [{ path: '', component: __WEBPACK_IMPORTED_MODULE_5__views_examples_Full__["a" /* default */] }, { path: 'full', component: __WEBPACK_IMPORTED_MODULE_5__views_examples_Full__["a" /* default */] }, { path: 'simple', component: __WEBPACK_IMPORTED_MODULE_6__views_examples_Simple__["a" /* default */] }, { path: 'avatar', component: __WEBPACK_IMPORTED_MODULE_7__views_examples_Avatar__["a" /* default */] }, { path: 'drag', component: __WEBPACK_IMPORTED_MODULE_8__views_examples_Drag__["a" /* default */] }, { path: 'multiple', component: __WEBPACK_IMPORTED_MODULE_9__views_examples_Multiple__["a" /* default */] }, { path: 'chunk', component: __WEBPACK_IMPORTED_MODULE_10__views_examples_Chunk__["a" /* default */] }, { path: 'vuex', component: __WEBPACK_IMPORTED_MODULE_11__views_examples_Vuex__["a" /* default */] }]; var router = new __WEBPACK_IMPORTED_MODULE_0_vue_router___default.a({ mode: 'hash', fallback: false, scrollBehavior: function scrollBehavior(to, from, savedPosition) { if (savedPosition) { return savedPosition; } else if (to.hash) { var el = document.querySelector(to.hash); return { x: 0, y: el ? el.offsetTop : 0 }; } else { return { x: 0, y: 0 }; } }, routes: [{ path: '/:locale(' + Object.keys(__WEBPACK_IMPORTED_MODULE_1__i18n__["a" /* default */].messages).join('|') + ')?', component: __WEBPACK_IMPORTED_MODULE_2__views_Router__["a" /* default */], children: [{ path: 'documents', component: __WEBPACK_IMPORTED_MODULE_3__views_Document__["a" /* default */] }, { path: 'examples', component: __WEBPACK_IMPORTED_MODULE_4__views_Example__["a" /* default */], children: examples }, { path: '', component: __WEBPACK_IMPORTED_MODULE_4__views_Example__["a" /* default */], children: examples }] }] }); /* harmony default export */ __webpack_exports__["a"] = (router); /***/ }), /* 27 */ /***/ (function(module, exports) { module.exports = VueRouter; /***/ }), /* 28 */ /***/ (function(module, exports) { module.exports = VueI18n; /***/ }), /* 29 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony default export */ __webpack_exports__["a"] = ({ header: { logo: 'Vuejs', home: 'Home', examples: 'Examples', documents: 'Documentation', blog: 'Blog', locale: 'Language(语言)', issues: 'Issues', github: 'Github' }, locale: { en: 'English', 'zh-cn': '中文(简体)' }, document: { title: 'Documentation' }, example: { full: 'Full Example', simple: 'Simple', avatar: 'Upload avatar', drag: 'Drag and drop', multiple: 'Multiple instances', chunk: 'Chunk upload', vuex: 'Vuex' } }); /***/ }), /* 30 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony default export */ __webpack_exports__["a"] = ({ header: { logo: 'Vuejs', home: '首页', examples: '演示', documents: '文档', blog: 'Blog', locale: 'Language(语言)', issues: 'Issues', github: 'Github' }, locale: { en: 'English', 'zh-cn': '中文(简体)' }, document: { title: '文档' }, example: { full: '完整例子', simple: '简单例子', avatar: '上传头像', drag: '拖拽上传', multiple: '多个实例', vuex: 'Vuex' } }); /***/ }), /* 31 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_vue_loader_lib_template_compiler_index_id_data_v_3075fd62_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Router_vue__ = __webpack_require__(32); var normalizeComponent = __webpack_require__(0) /* script */ var __vue_script__ = null /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = null /* scopeId */ var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __vue_script__, __WEBPACK_IMPORTED_MODULE_0__node_modules_vue_loader_lib_template_compiler_index_id_data_v_3075fd62_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Router_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["a"] = (Component.exports); /***/ }), /* 32 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('router-view')} var staticRenderFns = [] var esExports = { render: render, staticRenderFns: staticRenderFns } /* harmony default export */ __webpack_exports__["a"] = (esExports); /***/ }), /* 33 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_presets_env_modules_false_stage_0_plugins_transform_runtime_helpers_false_polyfill_false_regenerator_true_moduleName_babel_runtime_cacheDirectory_false_node_modules_vue_loader_lib_selector_type_script_index_0_Document_vue__ = __webpack_require__(7); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_61209807_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Document_vue__ = __webpack_require__(38); function injectStyle (ssrContext) { __webpack_require__(34) } var normalizeComponent = __webpack_require__(0) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_presets_env_modules_false_stage_0_plugins_transform_runtime_helpers_false_polyfill_false_regenerator_true_moduleName_babel_runtime_cacheDirectory_false_node_modules_vue_loader_lib_selector_type_script_index_0_Document_vue__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_61209807_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Document_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["a"] = (Component.exports); /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a