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 = 341);
|
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 | 341:
|
180 | (function(module, exports, __webpack_require__) {
|
181 |
|
182 | "use strict";
|
183 |
|
184 |
|
185 | exports.__esModule = true;
|
186 |
|
187 | var _item = __webpack_require__(342);
|
188 |
|
189 | var _item2 = _interopRequireDefault(_item);
|
190 |
|
191 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
192 |
|
193 |
|
194 | _item2.default.install = function (Vue) {
|
195 | Vue.component(_item2.default.name, _item2.default);
|
196 | };
|
197 |
|
198 | exports.default = _item2.default;
|
199 |
|
200 | }),
|
201 |
|
202 | 342:
|
203 | (function(module, __webpack_exports__, __webpack_require__) {
|
204 |
|
205 | "use strict";
|
206 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
207 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_item_vue__ = __webpack_require__(343);
|
208 | var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_item_vue__);
|
209 | var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_270b1a48_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_item_vue__ = __webpack_require__(344);
|
210 | var normalizeComponent = __webpack_require__(0)
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 | var __vue_template_functional__ = false
|
217 |
|
218 | var __vue_styles__ = null
|
219 |
|
220 | var __vue_scopeId__ = null
|
221 |
|
222 | var __vue_module_identifier__ = null
|
223 | var Component = normalizeComponent(
|
224 | __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_item_vue___default.a,
|
225 | __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_270b1a48_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_item_vue__["a" ],
|
226 | __vue_template_functional__,
|
227 | __vue_styles__,
|
228 | __vue_scopeId__,
|
229 | __vue_module_identifier__
|
230 | )
|
231 |
|
232 | __webpack_exports__["default"] = (Component.exports);
|
233 |
|
234 |
|
235 | }),
|
236 |
|
237 | 343:
|
238 | (function(module, exports, __webpack_require__) {
|
239 |
|
240 | "use strict";
|
241 |
|
242 |
|
243 | exports.__esModule = true;
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 | var CARD_SCALE = 0.83;
|
272 | exports.default = {
|
273 | name: 'ElCarouselItem',
|
274 |
|
275 | props: {
|
276 | name: String,
|
277 | label: {
|
278 | type: [String, Number],
|
279 | default: ''
|
280 | }
|
281 | },
|
282 |
|
283 | data: function data() {
|
284 | return {
|
285 | hover: false,
|
286 | translate: 0,
|
287 | scale: 1,
|
288 | active: false,
|
289 | ready: false,
|
290 | inStage: false,
|
291 | animating: false
|
292 | };
|
293 | },
|
294 |
|
295 |
|
296 | methods: {
|
297 | processIndex: function processIndex(index, activeIndex, length) {
|
298 | if (activeIndex === 0 && index === length - 1) {
|
299 | return -1;
|
300 | } else if (activeIndex === length - 1 && index === 0) {
|
301 | return length;
|
302 | } else if (index < activeIndex - 1 && activeIndex - index >= length / 2) {
|
303 | return length + 1;
|
304 | } else if (index > activeIndex + 1 && index - activeIndex >= length / 2) {
|
305 | return -2;
|
306 | }
|
307 | return index;
|
308 | },
|
309 | calculateTranslate: function calculateTranslate(index, activeIndex, parentWidth) {
|
310 | if (this.inStage) {
|
311 | return parentWidth * ((2 - CARD_SCALE) * (index - activeIndex) + 1) / 4;
|
312 | } else if (index < activeIndex) {
|
313 | return -(1 + CARD_SCALE) * parentWidth / 4;
|
314 | } else {
|
315 | return (3 + CARD_SCALE) * parentWidth / 4;
|
316 | }
|
317 | },
|
318 | translateItem: function translateItem(index, activeIndex, oldIndex) {
|
319 | var parentWidth = this.$parent.$el.offsetWidth;
|
320 | var length = this.$parent.items.length;
|
321 | if (this.$parent.type !== 'card' && oldIndex !== undefined) {
|
322 | this.animating = index === activeIndex || index === oldIndex;
|
323 | }
|
324 | if (index !== activeIndex && length > 2) {
|
325 | index = this.processIndex(index, activeIndex, length);
|
326 | }
|
327 | if (this.$parent.type === 'card') {
|
328 | this.inStage = Math.round(Math.abs(index - activeIndex)) <= 1;
|
329 | this.active = index === activeIndex;
|
330 | this.translate = this.calculateTranslate(index, activeIndex, parentWidth);
|
331 | this.scale = this.active ? 1 : CARD_SCALE;
|
332 | } else {
|
333 | this.active = index === activeIndex;
|
334 | this.translate = parentWidth * (index - activeIndex);
|
335 | }
|
336 | this.ready = true;
|
337 | },
|
338 | handleItemClick: function handleItemClick() {
|
339 | var parent = this.$parent;
|
340 | if (parent && parent.type === 'card') {
|
341 | var index = parent.items.indexOf(this);
|
342 | parent.setActiveItem(index);
|
343 | }
|
344 | }
|
345 | },
|
346 |
|
347 | created: function created() {
|
348 | this.$parent && this.$parent.updateItems();
|
349 | },
|
350 | destroyed: function destroyed() {
|
351 | this.$parent && this.$parent.updateItems();
|
352 | }
|
353 | };
|
354 |
|
355 | }),
|
356 |
|
357 | 344:
|
358 | (function(module, __webpack_exports__, __webpack_require__) {
|
359 |
|
360 | "use strict";
|
361 | var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.ready),expression:"ready"}],staticClass:"el-carousel__item",class:{
|
362 | 'is-active': _vm.active,
|
363 | 'el-carousel__item--card': _vm.$parent.type === 'card',
|
364 | 'is-in-stage': _vm.inStage,
|
365 | 'is-hover': _vm.hover,
|
366 | 'is-animating': _vm.animating
|
367 | },style:({
|
368 | msTransform: ("translateX(" + _vm.translate + "px) scale(" + _vm.scale + ")"),
|
369 | webkitTransform: ("translateX(" + _vm.translate + "px) scale(" + _vm.scale + ")"),
|
370 | transform: ("translateX(" + _vm.translate + "px) scale(" + _vm.scale + ")")
|
371 | }),on:{"click":_vm.handleItemClick}},[(_vm.$parent.type === 'card')?_c('div',{directives:[{name:"show",rawName:"v-show",value:(!_vm.active),expression:"!active"}],staticClass:"el-carousel__mask"}):_vm._e(),_vm._t("default")],2)}
|
372 | var staticRenderFns = []
|
373 | var esExports = { render: render, staticRenderFns: staticRenderFns }
|
374 | __webpack_exports__["a"] = (esExports);
|
375 |
|
376 | })
|
377 |
|
378 | }); |
\ | No newline at end of file |