1 | module.exports =
|
2 | (function(modules) {
|
3 |
|
4 | var installedModules = {};
|
5 |
|
6 |
|
7 | function __webpack_require__(moduleId) {
|
8 |
|
9 |
|
10 | if(installedModules[moduleId]) {
|
11 | return installedModules[moduleId].exports;
|
12 | }
|
13 |
|
14 | var module = installedModules[moduleId] = {
|
15 | i: moduleId,
|
16 | l: false,
|
17 | exports: {}
|
18 | };
|
19 |
|
20 |
|
21 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
22 |
|
23 |
|
24 | module.l = true;
|
25 |
|
26 |
|
27 | return module.exports;
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 | __webpack_require__.m = modules;
|
33 |
|
34 |
|
35 | __webpack_require__.c = installedModules;
|
36 |
|
37 |
|
38 | __webpack_require__.d = function(exports, name, getter) {
|
39 | if(!__webpack_require__.o(exports, name)) {
|
40 | Object.defineProperty(exports, name, {
|
41 | configurable: false,
|
42 | enumerable: true,
|
43 | get: getter
|
44 | /******/ });
|
45 | /******/ }
|
46 | /******/ };
|
47 | /******/
|
48 | /******/ // getDefaultExport function for compatibility with non-harmony modules
|
49 | /******/ __webpack_require__.n = function(module) {
|
50 | var getter = module && module.__esModule ?
|
51 | function getDefault() { return module['default']; } :
|
52 | function getModuleExports() { return module; };
|
53 | __webpack_require__.d(getter, 'a', getter);
|
54 | return getter;
|
55 | };
|
56 |
|
57 |
|
58 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
59 |
|
60 |
|
61 | __webpack_require__.p = "/dist/";
|
62 |
|
63 |
|
64 | return __webpack_require__(__webpack_require__.s = 332);
|
65 | })
|
66 |
|
67 | ({
|
68 |
|
69 | 0:
|
70 | (function(module, exports) {
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | module.exports = function normalizeComponent (
|
79 | rawScriptExports,
|
80 | compiledTemplate,
|
81 | functionalTemplate,
|
82 | injectStyles,
|
83 | scopeId,
|
84 | moduleIdentifier /* server only */
|
85 | ) {
|
86 | var esModule
|
87 | var scriptExports = rawScriptExports = rawScriptExports || {}
|
88 |
|
89 |
|
90 | var type = typeof rawScriptExports.default
|
91 | if (type === 'object' || type === 'function') {
|
92 | esModule = rawScriptExports
|
93 | scriptExports = rawScriptExports.default
|
94 | }
|
95 |
|
96 |
|
97 | var options = typeof scriptExports === 'function'
|
98 | ? scriptExports.options
|
99 | : scriptExports
|
100 |
|
101 |
|
102 | if (compiledTemplate) {
|
103 | options.render = compiledTemplate.render
|
104 | options.staticRenderFns = compiledTemplate.staticRenderFns
|
105 | options._compiled = true
|
106 | }
|
107 |
|
108 |
|
109 | if (functionalTemplate) {
|
110 | options.functional = true
|
111 | }
|
112 |
|
113 |
|
114 | if (scopeId) {
|
115 | options._scopeId = scopeId
|
116 | }
|
117 |
|
118 | var hook
|
119 | if (moduleIdentifier) {
|
120 | hook = function (context) {
|
121 |
|
122 | context =
|
123 | context ||
|
124 | (this.$vnode && this.$vnode.ssrContext) ||
|
125 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext)
|
126 |
|
127 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
128 | context = __VUE_SSR_CONTEXT__
|
129 | }
|
130 |
|
131 | if (injectStyles) {
|
132 | injectStyles.call(this, context)
|
133 | }
|
134 |
|
135 | if (context && context._registeredComponents) {
|
136 | context._registeredComponents.add(moduleIdentifier)
|
137 | }
|
138 | }
|
139 |
|
140 |
|
141 | options._ssrRegister = hook
|
142 | } else if (injectStyles) {
|
143 | hook = injectStyles
|
144 | }
|
145 |
|
146 | if (hook) {
|
147 | var functional = options.functional
|
148 | var existing = functional
|
149 | ? options.render
|
150 | : options.beforeCreate
|
151 |
|
152 | if (!functional) {
|
153 |
|
154 | options.beforeCreate = existing
|
155 | ? [].concat(existing, hook)
|
156 | : [hook]
|
157 | } else {
|
158 |
|
159 |
|
160 | options._injectStyles = hook
|
161 |
|
162 | options.render = function renderWithStyleInjection (h, context) {
|
163 | hook.call(context)
|
164 | return existing(h, context)
|
165 | }
|
166 | }
|
167 | }
|
168 |
|
169 | return {
|
170 | esModule: esModule,
|
171 | exports: scriptExports,
|
172 | options: options
|
173 | }
|
174 | }
|
175 |
|
176 |
|
177 | }),
|
178 |
|
179 | 18:
|
180 | (function(module, exports) {
|
181 |
|
182 | module.exports = require("element-ui/lib/utils/resize-event");
|
183 |
|
184 | }),
|
185 |
|
186 | 332:
|
187 | (function(module, exports, __webpack_require__) {
|
188 |
|
189 | "use strict";
|
190 |
|
191 |
|
192 | exports.__esModule = true;
|
193 |
|
194 | var _main = __webpack_require__(333);
|
195 |
|
196 | var _main2 = _interopRequireDefault(_main);
|
197 |
|
198 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
199 |
|
200 |
|
201 | _main2.default.install = function (Vue) {
|
202 | Vue.component(_main2.default.name, _main2.default);
|
203 | };
|
204 |
|
205 | exports.default = _main2.default;
|
206 |
|
207 | }),
|
208 |
|
209 | 333:
|
210 | (function(module, __webpack_exports__, __webpack_require__) {
|
211 |
|
212 | "use strict";
|
213 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
214 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_main_vue__ = __webpack_require__(334);
|
215 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_main_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_main_vue__);
|
216 | var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_b46b8afc_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_main_vue__ = __webpack_require__(336);
|
217 | var normalizeComponent = __webpack_require__(0)
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 | var __vue_template_functional__ = false
|
224 |
|
225 | var __vue_styles__ = null
|
226 |
|
227 | var __vue_scopeId__ = null
|
228 |
|
229 | var __vue_module_identifier__ = null
|
230 | var Component = normalizeComponent(
|
231 | __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_main_vue___default.a,
|
232 | __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_b46b8afc_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_main_vue__["a" ],
|
233 | __vue_template_functional__,
|
234 | __vue_styles__,
|
235 | __vue_scopeId__,
|
236 | __vue_module_identifier__
|
237 | )
|
238 |
|
239 | __webpack_exports__["default"] = (Component.exports);
|
240 |
|
241 |
|
242 | }),
|
243 |
|
244 | 334:
|
245 | (function(module, exports, __webpack_require__) {
|
246 |
|
247 | "use strict";
|
248 |
|
249 |
|
250 | exports.__esModule = true;
|
251 |
|
252 | var _throttle = __webpack_require__(335);
|
253 |
|
254 | var _throttle2 = _interopRequireDefault(_throttle);
|
255 |
|
256 | var _resizeEvent = __webpack_require__(18);
|
257 |
|
258 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 | exports.default = {
|
313 | name: 'ElCarousel',
|
314 |
|
315 | props: {
|
316 | initialIndex: {
|
317 | type: Number,
|
318 | default: 0
|
319 | },
|
320 | height: String,
|
321 | trigger: {
|
322 | type: String,
|
323 | default: 'hover'
|
324 | },
|
325 | autoplay: {
|
326 | type: Boolean,
|
327 | default: true
|
328 | },
|
329 | interval: {
|
330 | type: Number,
|
331 | default: 3000
|
332 | },
|
333 | indicatorPosition: String,
|
334 | indicator: {
|
335 | type: Boolean,
|
336 | default: true
|
337 | },
|
338 | arrow: {
|
339 | type: String,
|
340 | default: 'hover'
|
341 | },
|
342 | type: String
|
343 | },
|
344 |
|
345 | data: function data() {
|
346 | return {
|
347 | items: [],
|
348 | activeIndex: -1,
|
349 | containerWidth: 0,
|
350 | timer: null,
|
351 | hover: false
|
352 | };
|
353 | },
|
354 |
|
355 |
|
356 | computed: {
|
357 | hasLabel: function hasLabel() {
|
358 | return this.items.some(function (item) {
|
359 | return item.label.toString().length > 0;
|
360 | });
|
361 | }
|
362 | },
|
363 |
|
364 | watch: {
|
365 | items: function items(val) {
|
366 | if (val.length > 0) this.setActiveItem(this.initialIndex);
|
367 | },
|
368 | activeIndex: function activeIndex(val, oldVal) {
|
369 | this.resetItemPosition(oldVal);
|
370 | this.$emit('change', val, oldVal);
|
371 | },
|
372 | autoplay: function autoplay(val) {
|
373 | val ? this.startTimer() : this.pauseTimer();
|
374 | }
|
375 | },
|
376 |
|
377 | methods: {
|
378 | handleMouseEnter: function handleMouseEnter() {
|
379 | this.hover = true;
|
380 | this.pauseTimer();
|
381 | },
|
382 | handleMouseLeave: function handleMouseLeave() {
|
383 | this.hover = false;
|
384 | this.startTimer();
|
385 | },
|
386 | itemInStage: function itemInStage(item, index) {
|
387 | var length = this.items.length;
|
388 | if (index === length - 1 && item.inStage && this.items[0].active || item.inStage && this.items[index + 1] && this.items[index + 1].active) {
|
389 | return 'left';
|
390 | } else if (index === 0 && item.inStage && this.items[length - 1].active || item.inStage && this.items[index - 1] && this.items[index - 1].active) {
|
391 | return 'right';
|
392 | }
|
393 | return false;
|
394 | },
|
395 | handleButtonEnter: function handleButtonEnter(arrow) {
|
396 | var _this = this;
|
397 |
|
398 | this.items.forEach(function (item, index) {
|
399 | if (arrow === _this.itemInStage(item, index)) {
|
400 | item.hover = true;
|
401 | }
|
402 | });
|
403 | },
|
404 | handleButtonLeave: function handleButtonLeave() {
|
405 | this.items.forEach(function (item) {
|
406 | item.hover = false;
|
407 | });
|
408 | },
|
409 | updateItems: function updateItems() {
|
410 | this.items = this.$children.filter(function (child) {
|
411 | return child.$options.name === 'ElCarouselItem';
|
412 | });
|
413 | },
|
414 | resetItemPosition: function resetItemPosition(oldIndex) {
|
415 | var _this2 = this;
|
416 |
|
417 | this.items.forEach(function (item, index) {
|
418 | item.translateItem(index, _this2.activeIndex, oldIndex);
|
419 | });
|
420 | },
|
421 | playSlides: function playSlides() {
|
422 | if (this.activeIndex < this.items.length - 1) {
|
423 | this.activeIndex++;
|
424 | } else {
|
425 | this.activeIndex = 0;
|
426 | }
|
427 | },
|
428 | pauseTimer: function pauseTimer() {
|
429 | clearInterval(this.timer);
|
430 | },
|
431 | startTimer: function startTimer() {
|
432 | if (this.interval <= 0 || !this.autoplay) return;
|
433 | this.timer = setInterval(this.playSlides, this.interval);
|
434 | },
|
435 | setActiveItem: function setActiveItem(index) {
|
436 | if (typeof index === 'string') {
|
437 | var filteredItems = this.items.filter(function (item) {
|
438 | return item.name === index;
|
439 | });
|
440 | if (filteredItems.length > 0) {
|
441 | index = this.items.indexOf(filteredItems[0]);
|
442 | }
|
443 | }
|
444 | index = Number(index);
|
445 | if (isNaN(index) || index !== Math.floor(index)) {
|
446 | "production" !== 'production' && console.warn('[Element Warn][Carousel]index must be an integer.');
|
447 | return;
|
448 | }
|
449 | var length = this.items.length;
|
450 | var oldIndex = this.activeIndex;
|
451 | if (index < 0) {
|
452 | this.activeIndex = length - 1;
|
453 | } else if (index >= length) {
|
454 | this.activeIndex = 0;
|
455 | } else {
|
456 | this.activeIndex = index;
|
457 | }
|
458 | if (oldIndex === this.activeIndex) {
|
459 | this.resetItemPosition(oldIndex);
|
460 | }
|
461 | },
|
462 | prev: function prev() {
|
463 | this.setActiveItem(this.activeIndex - 1);
|
464 | },
|
465 | next: function next() {
|
466 | this.setActiveItem(this.activeIndex + 1);
|
467 | },
|
468 | handleIndicatorClick: function handleIndicatorClick(index) {
|
469 | this.activeIndex = index;
|
470 | },
|
471 | handleIndicatorHover: function handleIndicatorHover(index) {
|
472 | if (this.trigger === 'hover' && index !== this.activeIndex) {
|
473 | this.activeIndex = index;
|
474 | }
|
475 | }
|
476 | },
|
477 |
|
478 | created: function created() {
|
479 | var _this3 = this;
|
480 |
|
481 | this.throttledArrowClick = (0, _throttle2.default)(300, true, function (index) {
|
482 | _this3.setActiveItem(index);
|
483 | });
|
484 | this.throttledIndicatorHover = (0, _throttle2.default)(300, function (index) {
|
485 | _this3.handleIndicatorHover(index);
|
486 | });
|
487 | },
|
488 | mounted: function mounted() {
|
489 | var _this4 = this;
|
490 |
|
491 | this.updateItems();
|
492 | this.$nextTick(function () {
|
493 | (0, _resizeEvent.addResizeListener)(_this4.$el, _this4.resetItemPosition);
|
494 | if (_this4.initialIndex < _this4.items.length && _this4.initialIndex >= 0) {
|
495 | _this4.activeIndex = _this4.initialIndex;
|
496 | }
|
497 | _this4.startTimer();
|
498 | });
|
499 | },
|
500 | beforeDestroy: function beforeDestroy() {
|
501 | if (this.$el) (0, _resizeEvent.removeResizeListener)(this.$el, this.resetItemPosition);
|
502 | }
|
503 | };
|
504 |
|
505 | }),
|
506 |
|
507 | 335:
|
508 | (function(module, exports) {
|
509 |
|
510 | module.exports = require("throttle-debounce/throttle");
|
511 |
|
512 | }),
|
513 |
|
514 | 336:
|
515 | (function(module, __webpack_exports__, __webpack_require__) {
|
516 |
|
517 | "use strict";
|
518 | var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"el-carousel",class:{ 'el-carousel--card': _vm.type === 'card' },on:{"mouseenter":function($event){$event.stopPropagation();_vm.handleMouseEnter($event)},"mouseleave":function($event){$event.stopPropagation();_vm.handleMouseLeave($event)}}},[_c('div',{staticClass:"el-carousel__container",style:({ height: _vm.height })},[_c('transition',{attrs:{"name":"carousel-arrow-left"}},[(_vm.arrow !== 'never')?_c('button',{directives:[{name:"show",rawName:"v-show",value:(_vm.arrow === 'always' || _vm.hover),expression:"arrow === 'always' || hover"}],staticClass:"el-carousel__arrow el-carousel__arrow--left",attrs:{"type":"button"},on:{"mouseenter":function($event){_vm.handleButtonEnter('left')},"mouseleave":_vm.handleButtonLeave,"click":function($event){$event.stopPropagation();_vm.throttledArrowClick(_vm.activeIndex - 1)}}},[_c('i',{staticClass:"el-icon-arrow-left"})]):_vm._e()]),_c('transition',{attrs:{"name":"carousel-arrow-right"}},[(_vm.arrow !== 'never')?_c('button',{directives:[{name:"show",rawName:"v-show",value:(_vm.arrow === 'always' || _vm.hover),expression:"arrow === 'always' || hover"}],staticClass:"el-carousel__arrow el-carousel__arrow--right",attrs:{"type":"button"},on:{"mouseenter":function($event){_vm.handleButtonEnter('right')},"mouseleave":_vm.handleButtonLeave,"click":function($event){$event.stopPropagation();_vm.throttledArrowClick(_vm.activeIndex + 1)}}},[_c('i',{staticClass:"el-icon-arrow-right"})]):_vm._e()]),_vm._t("default")],2),(_vm.indicatorPosition !== 'none')?_c('ul',{staticClass:"el-carousel__indicators",class:{ 'el-carousel__indicators--labels': _vm.hasLabel, 'el-carousel__indicators--outside': _vm.indicatorPosition === 'outside' || _vm.type === 'card' }},_vm._l((_vm.items),function(item,index){return _c('li',{staticClass:"el-carousel__indicator",class:{ 'is-active': index === _vm.activeIndex },on:{"mouseenter":function($event){_vm.throttledIndicatorHover(index)},"click":function($event){$event.stopPropagation();_vm.handleIndicatorClick(index)}}},[_c('button',{staticClass:"el-carousel__button"},[(_vm.hasLabel)?_c('span',[_vm._v(_vm._s(item.label))]):_vm._e()])])})):_vm._e()])}
|
519 | var staticRenderFns = []
|
520 | var esExports = { render: render, staticRenderFns: staticRenderFns }
|
521 | __webpack_exports__["a"] = (esExports);
|
522 |
|
523 | })
|
524 |
|
525 | }); |
\ | No newline at end of file |