From b2e7226027dc4f19b527e76279673178139ddedb Mon Sep 17 00:00:00 2001 From: TANG <40519806@qq.com> Date: Wed, 21 Aug 2019 10:49:41 +0800 Subject: [PATCH] Eslint --fix. --- .babelrc | 6 +- .eslintrc.json | 71 +- README.md | 148 ++-- demos/common/Corner.vue | 42 +- demos/common/Header.vue | 186 ++-- demos/common/Item.vue | 276 +++--- demos/common/app.less | 50 +- demos/common/createApp.js | 22 +- demos/common/util.js | 430 ++++----- demos/demo.html | 6 +- demos/item-mode/App.vue | 94 +- demos/item-mode/build.js | 2 +- demos/item-mode/index.html | 6 +- demos/page-mode/App.vue | 98 +-- demos/page-mode/build.js | 2 +- demos/page-mode/index.html | 6 +- demos/scroll-element/App.vue | 117 ++- demos/scroll-element/build.js | 2 +- demos/scroll-element/index.html | 6 +- demos/variable-height/App.vue | 110 +-- demos/variable-height/build.js | 2 +- demos/variable-height/index.html | 6 +- demos/vfor-mode/App.vue | 92 +- demos/vfor-mode/build.js | 2 +- demos/vfor-mode/index.html | 6 +- demos/webpack.conf.js | 142 +-- demos/without-virtual-list/App.vue | 86 +- demos/without-virtual-list/build.js | 2 +- demos/without-virtual-list/index.html | 6 +- dist/index.js | 14 +- jest.config.js | 28 +- package.json | 1 + src/index.js | 1150 +++++++++++++------------ test/aria.test.js | 100 +-- test/base.test.js | 114 +-- test/element.test.js | 98 +-- test/event.test.js | 182 ++-- test/itemcount.test.js | 132 +-- test/pagemode.test.js | 252 +++--- test/pos.conflict.test.js | 112 +-- test/pos.offset.test.js | 112 +-- test/pos.start.test.js | 224 ++--- test/scrollelement.test.js | 248 +++--- test/shape.test.js | 200 ++--- test/util.js | 26 +- test/variable.fn.test.js | 184 ++-- test/variable.true.test.js | 104 +-- 47 files changed, 2657 insertions(+), 2648 deletions(-) diff --git a/.babelrc b/.babelrc index 259eb1c..ece1d87 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,5 @@ { - "presets": [ - ["@babel/preset-env"] - ] + "presets": [ + ["@babel/preset-env"] + ] } diff --git a/.eslintrc.json b/.eslintrc.json index ebd10d5..7804ac8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,37 +1,36 @@ { - "extends": [ - "standard", - "plugin:vue/recommended" - ], - "env": { - "browser": true, - "amd": true - }, - "globals": { - "it": "readonly", - "expect": "readonly", - "describe": "readonly" - }, - "parserOptions": { - "ecmaVersion": 5, - "sourceType": "module" - }, - "rules": { - "indent": ["error", 4], - "arrow-parens": 0, - "generator-star-spacing": 0, - "no-trailing-spaces": [ 0, { "skipBlankLines": true } ], - "vue/html-indent": ["error", 4, { - "baseIndent": 0, - "alignAttributesVertically": false - }], - "vue/script-indent": ["error", 4], - "vue/max-attributes-per-line": ["error", { - "singleline": 10, - "multiline": { - "max": 10, - "allowFirstLine": true - } - }] - } -} \ No newline at end of file + "extends": [ + "standard", + "plugin:vue/recommended" + ], + "env": { + "browser": true, + "amd": true + }, + "globals": { + "it": "readonly", + "expect": "readonly", + "describe": "readonly" + }, + "parserOptions": { + "ecmaVersion": 5, + "sourceType": "module" + }, + "rules": { + "arrow-parens": 0, + "generator-star-spacing": 0, + "no-trailing-spaces": [ 0, { "skipBlankLines": true } ], + "vue/html-indent": ["error", 2, { + "baseIndent": 0, + "alignAttributesVertically": false + }], + "vue/script-indent": ["error", 2], + "vue/max-attributes-per-line": ["error", { + "singleline": 10, + "multiline": { + "max": 10, + "allowFirstLine": true + } + }] + } +} diff --git a/README.md b/README.md index 2d9e053..d24220a 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,25 @@

- - Travis CI Status - - - Code Coverage - - - NPM downloads - - - Package quality - - - NPM version - - - Vue version - - - License - + + Travis CI Status + + + Code Coverage + + + NPM downloads + + + Package quality + + + NPM version + + + Vue version + + + License +

## Table of contents @@ -28,12 +28,12 @@ * [Live demos](#live-demos) * [How it works](#how-it-works) * [Simple usage](#simple-usage) - * [vfor-mode](#vfor-mode) - * [item-mode](#item-mode) - * [variable height](#variable-height) + * [vfor-mode](#vfor-mode) + * [item-mode](#item-mode) + * [variable height](#variable-height) * [Performance comparison](#performance-comparison) - * [Build time wasted](#build-time-wasted) - * [Total memory used](#total-memory-used) + * [Build time wasted](#build-time-wasted) + * [Total memory used](#total-memory-used) * [Attentions](#attentions) * [**Props type**](#props-type) * [Public methods](#public-methods) @@ -80,23 +80,23 @@ All you need to care about is only data! ```vue ``` @@ -106,36 +106,36 @@ This mode can save a considerable amount of memory and performance. Props `item` ```vue ``` @@ -149,11 +149,11 @@ Using variable height, props `remain` and `size` is still required. All the inde If you assign `variable` as `true`, **do not** set inline style height inside `` component, you **must** set inline style height on `` component outside directly, such as: ```vue ``` diff --git a/demos/common/Corner.vue b/demos/common/Corner.vue index d9ee866..bdc8de1 100644 --- a/demos/common/Corner.vue +++ b/demos/common/Corner.vue @@ -1,10 +1,10 @@ @@ -12,26 +12,26 @@ import { isMobile } from './util' export default { - name: 'GithubCorner', + name: 'GithubCorner', - props: { - path: { - type: String, - default: '' - } - }, + props: { + path: { + type: String, + default: '' + } + }, - data () { - return { - size: isMobile ? 40 : 80 - } - }, + data () { + return { + size: isMobile ? 40 : 80 + } + }, - computed: { - url () { - return `https://github.com/tangbc/vue-virtual-scroll-list/tree/master/demos` + (this.path || '') - } + computed: { + url () { + return `https://github.com/tangbc/vue-virtual-scroll-list/tree/master/demos` + (this.path || '') } + } } diff --git a/demos/common/Header.vue b/demos/common/Header.vue index 4bcdeac..e2c5707 100644 --- a/demos/common/Header.vue +++ b/demos/common/Header.vue @@ -1,43 +1,43 @@ @@ -45,72 +45,72 @@ import { isMobile, debounce, countStorage, settingStorage } from './util' export default { - name: 'AppHeader', + name: 'AppHeader', - props: { - warning: Boolean, - title: { - type: String, - default: '' - }, - desciption: { - type: String, - default: '' - }, - startIndex: { - type: Number, - default: 0 - }, - onDataChange: { - type: Function, - default: () => {} - } + props: { + warning: Boolean, + title: { + type: String, + default: '' }, - - data () { - return { - isMobile, - selfStartIndex: 0, - showSetting: settingStorage.isShow(), - renderCount: String(countStorage.get()).length - 3 - } + desciption: { + type: String, + default: '' }, - - computed: { - showStart () { - return this.startIndex !== undefined - }, - - isRenderSetting () { - return this.showSetting && (this.showStart) - } + startIndex: { + type: Number, + default: 0 }, + onDataChange: { + type: Function, + default: () => {} + } + }, - watch: { - renderCount (val) { - countStorage.set(val) - window.location.reload() - } - }, + data () { + return { + isMobile, + selfStartIndex: 0, + showSetting: settingStorage.isShow(), + renderCount: String(countStorage.get()).length - 3 + } + }, - mounted () { - this.selfStartIndex = this.startIndex + computed: { + showStart () { + return this.startIndex !== undefined }, - methods: { - clickIcon () { - const nextStatus = !this.showSetting - this.showSetting = nextStatus - settingStorage.setShow(nextStatus) - }, + isRenderSetting () { + return this.showSetting && (this.showStart) + } + }, - inputDataChange: debounce(function (type, value) { - const val = Number(value) - if (this.onDataChange && value !== '' && !isNaN(val) && val >= 0) { - this.onDataChange(type, val) - } - }, 1000, false) + watch: { + renderCount (val) { + countStorage.set(val) + window.location.reload() } + }, + + mounted () { + this.selfStartIndex = this.startIndex + }, + + methods: { + clickIcon () { + const nextStatus = !this.showSetting + this.showSetting = nextStatus + settingStorage.setShow(nextStatus) + }, + + inputDataChange: debounce(function (type, value) { + const val = Number(value) + if (this.onDataChange && value !== '' && !isNaN(val) && val >= 0) { + this.onDataChange(type, val) + } + }, 1000, false) + } } diff --git a/demos/common/Item.vue b/demos/common/Item.vue index f346221..1843d69 100644 --- a/demos/common/Item.vue +++ b/demos/common/Item.vue @@ -1,28 +1,28 @@ @@ -30,141 +30,141 @@ import { getQuery } from './util' export default { - name: 'Item', + name: 'Item', - props: { - height: { - type: Number, - default: 0 - }, - index: { - type: Number, - default: 0 - }, - variable: Boolean, - info: { - type: Object, - default: () => ({ - name: '', - time: '', - avatar: '', - color: '' - }) - } + props: { + height: { + type: Number, + default: 0 }, - - data () { - return { - avatar: getQuery('avatar') !== null - } + index: { + type: Number, + default: 0 }, + variable: Boolean, + info: { + type: Object, + default: () => ({ + name: '', + time: '', + avatar: '', + color: '' + }) + } + }, - computed: { - itemStyle () { - return { - 'height': `${this.height}px`, - 'line-height': `${this.height}px` - } - } - }, + data () { + return { + avatar: getQuery('avatar') !== null + } + }, - methods: { - getAbbrName (name) { - const arr = name.split(' ') - if (arr.length > 1) { - return arr[0][0] + arr[1][0] - } else { - return name.substr(0, 2) - } - } + computed: { + itemStyle () { + return { + 'height': `${this.height}px`, + 'line-height': `${this.height}px` + } + } + }, + + methods: { + getAbbrName (name) { + const arr = name.split(' ') + if (arr.length > 1) { + return arr[0][0] + arr[1][0] + } else { + return name.substr(0, 2) + } } + } } diff --git a/demos/common/app.less b/demos/common/app.less index ba729ba..004cfcf 100644 --- a/demos/common/app.less +++ b/demos/common/app.less @@ -1,37 +1,37 @@ * { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } html,body { - height: 100%; - overflow: hidden; - font-size: 16px; - font-family: serif; + height: 100%; + overflow: hidden; + font-size: 16px; + font-family: serif; } .app { - height: 100%; - position: relative; - z-index: 1; + height: 100%; + position: relative; + z-index: 1; } .container { - width: 520px; - height: 50%; - position: absolute; - left: 50%; - transform: translateX(-50%); - @media (max-width: 640px) { - width: 90%; - } + width: 520px; + height: 50%; + position: absolute; + left: 50%; + transform: translateX(-50%); + @media (max-width: 640px) { + width: 90%; + } } .main { - padding: 5px; - border-radius: 3px; - background-color: #66cdaa; - @media (max-width: 640px) { - padding: 3px; - } + padding: 5px; + border-radius: 3px; + background-color: #66cdaa; + @media (max-width: 640px) { + padding: 3px; + } } .list { - background-color: #ffffff; - -webkit-overflow-scrolling: touch; + background-color: #ffffff; + -webkit-overflow-scrolling: touch; } diff --git a/demos/common/createApp.js b/demos/common/createApp.js index cb57506..576da3b 100644 --- a/demos/common/createApp.js +++ b/demos/common/createApp.js @@ -4,18 +4,18 @@ import GithubCorner from './Corner.vue' import { reportPerformance } from './util' export default function (App) { - Vue.config.devtools = false - Vue.config.productionTip = false + Vue.config.devtools = false + Vue.config.productionTip = false - Vue.component('Header', Header) - Vue.component('GithubCorner', GithubCorner) + Vue.component('Header', Header) + Vue.component('GithubCorner', GithubCorner) - window.app_init_time = Date.now() + window.app_init_time = Date.now() - new Vue({ - mounted () { - reportPerformance() - }, - render: (h) => h(App) - }).$mount('#app') + new Vue({ + mounted () { + reportPerformance() + }, + render: (h) => h(App) + }).$mount('#app') } diff --git a/demos/common/util.js b/demos/common/util.js index 7b8af1f..63ed211 100644 --- a/demos/common/util.js +++ b/demos/common/util.js @@ -1,197 +1,197 @@ import { Random } from './mock.min' const topTypeArr = [ - 'NoHair', - 'Eyepatch', - 'Hat', - 'Hijab', - 'Turban', - 'WinterHat1', - 'WinterHat2', - 'WinterHat3', - 'WinterHat4', - 'LongHairBigHair', - 'LongHairBob', - 'LongHairBun', - 'LongHairCurly', - 'LongHairCurvy', - 'LongHairDreads', - 'LongHairFrida', - 'LongHairFro', - 'LongHairFroBand', - 'LongHairNotTooLong', - 'LongHairShavedSides', - 'LongHairMiaWallace', - 'LongHairStraight', - 'LongHairStraight2', - 'LongHairStraightStrand', - 'ShortHairDreads01', - 'ShortHairDreads02', - 'ShortHairFrizzle', - 'ShortHairShaggyMullet', - 'ShortHairShortCurly', - 'ShortHairShortFlat', - 'ShortHairShortRound', - 'ShortHairShortWaved', - 'ShortHairSides', - 'ShortHairTheCaesar', - 'ShortHairTheCaesarSidePart' + 'NoHair', + 'Eyepatch', + 'Hat', + 'Hijab', + 'Turban', + 'WinterHat1', + 'WinterHat2', + 'WinterHat3', + 'WinterHat4', + 'LongHairBigHair', + 'LongHairBob', + 'LongHairBun', + 'LongHairCurly', + 'LongHairCurvy', + 'LongHairDreads', + 'LongHairFrida', + 'LongHairFro', + 'LongHairFroBand', + 'LongHairNotTooLong', + 'LongHairShavedSides', + 'LongHairMiaWallace', + 'LongHairStraight', + 'LongHairStraight2', + 'LongHairStraightStrand', + 'ShortHairDreads01', + 'ShortHairDreads02', + 'ShortHairFrizzle', + 'ShortHairShaggyMullet', + 'ShortHairShortCurly', + 'ShortHairShortFlat', + 'ShortHairShortRound', + 'ShortHairShortWaved', + 'ShortHairSides', + 'ShortHairTheCaesar', + 'ShortHairTheCaesarSidePart' ] const accessoriesTypeArr = [ - 'Blank', - 'Kurt', - 'Prescription01', - 'Prescription02', - 'Round', - 'Sunglasses', - 'Wayfarers' + 'Blank', + 'Kurt', + 'Prescription01', + 'Prescription02', + 'Round', + 'Sunglasses', + 'Wayfarers' ] const facialHairTypeArr = [ - 'Blank', - 'BeardMedium', - 'BeardLight', - 'BeardMagestic', - 'MoustacheFancy', - 'MoustacheMagnum' + 'Blank', + 'BeardMedium', + 'BeardLight', + 'BeardMagestic', + 'MoustacheFancy', + 'MoustacheMagnum' ] const facialHairColor = [ - 'Auburn', - 'Black', - 'Blonde', - 'BlondeGolden', - 'Brown', - 'BrownDark', - 'Platinum', - 'Red' + 'Auburn', + 'Black', + 'Blonde', + 'BlondeGolden', + 'Brown', + 'BrownDark', + 'Platinum', + 'Red' ] const clotheTypeArr = [ - 'BlazerShirt', - 'BlazerSweater', - 'CollarSweater', - 'GraphicShirt', - 'Hoodie', - 'Overall', - 'ShirtCrewNeck', - 'ShirtScoopNeck', - 'ShirtVNeck' + 'BlazerShirt', + 'BlazerSweater', + 'CollarSweater', + 'GraphicShirt', + 'Hoodie', + 'Overall', + 'ShirtCrewNeck', + 'ShirtScoopNeck', + 'ShirtVNeck' ] const clotheColor = [ - 'Black', - 'Blue01', - 'Blue02', - 'Blue03', - 'Gray01', - 'Gray02', - 'Heather', - 'PastelBlue', - 'PastelGreen', - 'PastelOrange', - 'PastelRed', - 'PastelYellow', - 'Pink', - 'Red', - 'White' + 'Black', + 'Blue01', + 'Blue02', + 'Blue03', + 'Gray01', + 'Gray02', + 'Heather', + 'PastelBlue', + 'PastelGreen', + 'PastelOrange', + 'PastelRed', + 'PastelYellow', + 'Pink', + 'Red', + 'White' ] const graphicTypeArr = [ - 'Bat', - 'Cumbia', - 'Deer', - 'Diamond', - 'Hola', - 'Pizza', - 'Resist', - 'Selena', - 'Bear', - 'SkullOutline', - 'Skull' + 'Bat', + 'Cumbia', + 'Deer', + 'Diamond', + 'Hola', + 'Pizza', + 'Resist', + 'Selena', + 'Bear', + 'SkullOutline', + 'Skull' ] const eyeTypeArr = [ - 'Close', - 'Cry', - 'Default', - 'Dizzy', - 'EyeRoll', - 'Happy', - 'Hearts', - 'Side', - 'Squint', - 'Surprised', - 'Wink', - 'WinkWacky' + 'Close', + 'Cry', + 'Default', + 'Dizzy', + 'EyeRoll', + 'Happy', + 'Hearts', + 'Side', + 'Squint', + 'Surprised', + 'Wink', + 'WinkWacky' ] const eyebrowTypeArr = [ - 'Angry', - 'AngryNatural', - 'Default', - 'DefaultNatural', - 'FlatNatural', - 'RaisedExcited', - 'RaisedExcitedNatural', - 'SadConcerned', - 'SadConcernedNatural', - 'UnibrowNatural', - 'UpDown', - 'UpDownNatural' + 'Angry', + 'AngryNatural', + 'Default', + 'DefaultNatural', + 'FlatNatural', + 'RaisedExcited', + 'RaisedExcitedNatural', + 'SadConcerned', + 'SadConcernedNatural', + 'UnibrowNatural', + 'UpDown', + 'UpDownNatural' ] const mouthTypeArr = [ - 'Concerned', - 'Default', - 'Disbelief', - 'Eating', - 'Grimace', - 'Sad', - 'ScreamOpen', - 'Serious', - 'Smile', - 'Tongue', - 'Twinkle', - 'Vomit' + 'Concerned', + 'Default', + 'Disbelief', + 'Eating', + 'Grimace', + 'Sad', + 'ScreamOpen', + 'Serious', + 'Smile', + 'Tongue', + 'Twinkle', + 'Vomit' ] const skinColorArr = [ - 'Tanned', - 'Yellow', - 'Pale', - 'Light', - 'Brown', - 'DarkBrown', - 'Black' + 'Tanned', + 'Yellow', + 'Pale', + 'Light', + 'Brown', + 'DarkBrown', + 'Black' ] export const getRandomAvatar = () => { - return 'https://avataaars.io/?' + [ - `avatarStyle=Transparent`, - `topType=${Random.pick(topTypeArr)}`, - `accessoriesType=${Random.pick(accessoriesTypeArr)}`, - `hatColor=${Random.pick(facialHairTypeArr)}`, - `facialHairType=${Random.pick(facialHairTypeArr)}`, - `facialHairColor=${Random.pick(facialHairColor)}`, - `clotheType=${Random.pick(clotheTypeArr)}`, - `clotheColor=${Random.pick(clotheColor)}`, - `graphicType=${Random.pick(graphicTypeArr)}`, - `eyeType=${Random.pick(eyeTypeArr)}`, - `eyebrowType=${Random.pick(eyebrowTypeArr)}`, - `mouthType=${Random.pick(mouthTypeArr)}`, - `skinColor=${Random.pick(skinColorArr)}` - ].join('&') + return 'https://avataaars.io/?' + [ + `avatarStyle=Transparent`, + `topType=${Random.pick(topTypeArr)}`, + `accessoriesType=${Random.pick(accessoriesTypeArr)}`, + `hatColor=${Random.pick(facialHairTypeArr)}`, + `facialHairType=${Random.pick(facialHairTypeArr)}`, + `facialHairColor=${Random.pick(facialHairColor)}`, + `clotheType=${Random.pick(clotheTypeArr)}`, + `clotheColor=${Random.pick(clotheColor)}`, + `graphicType=${Random.pick(graphicTypeArr)}`, + `eyeType=${Random.pick(eyeTypeArr)}`, + `eyebrowType=${Random.pick(eyebrowTypeArr)}`, + `mouthType=${Random.pick(mouthTypeArr)}`, + `skinColor=${Random.pick(skinColorArr)}` + ].join('&') } export const getRandomUser = () => { - return { - name: Random.name(), - time: Random.date(), - color: Random.color(), - avatar: getRandomAvatar() - } + return { + name: Random.name(), + time: Random.date(), + color: Random.color(), + avatar: getRandomAvatar() + } } export const getRandomHeight = () => Random.pick([40, 50, 80, 100, 140, 180]) export const getQuery = (query) => { - try { - return new URLSearchParams(window.location.search).get(query) - } catch (e) { - return false - } + try { + return new URLSearchParams(window.location.search).get(query) + } catch (e) { + return false + } } const ua = navigator.userAgent @@ -200,78 +200,78 @@ export const iOS = !!ua.match(/iPhone|iPad|iPod/i) export const isMobile = Android || iOS export const debounce = (func, wait, immediate) => { - let timeout - return function () { - const context = this - const args = arguments - const later = function () { - timeout = null - if (!immediate) { - func.apply(context, args) - } - } - const callNow = immediate && !timeout - clearTimeout(timeout) - timeout = setTimeout(later, wait) - if (callNow) { - func.apply(context, args) - } + let timeout + return function () { + const context = this + const args = arguments + const later = function () { + timeout = null + if (!immediate) { + func.apply(context, args) + } + } + const callNow = immediate && !timeout + clearTimeout(timeout) + timeout = setTimeout(later, wait) + if (callNow) { + func.apply(context, args) } + } } const oneThousand = 1000 const typeMap = { - 1: oneThousand, - 2: oneThousand * 10, - 3: oneThousand * 100 + 1: oneThousand, + 2: oneThousand * 10, + 3: oneThousand * 100 } // browser will crash render 100,000 in example `without-virtual-list`. const isWitoutVirtual = window.location.href.indexOf('without-virtual-list') > -1 const defaultCount = typeMap[isWitoutVirtual ? 2 : 3] export const countStorage = { - get () { - try { - return +sessionStorage.getItem('RENDER-COUNT') || defaultCount - } catch (e) { - return defaultCount - } - }, - - set (type) { - try { - sessionStorage.setItem('RENDER-COUNT', typeMap[type] || defaultCount) - } catch (e) {} + get () { + try { + return +sessionStorage.getItem('RENDER-COUNT') || defaultCount + } catch (e) { + return defaultCount } + }, + + set (type) { + try { + sessionStorage.setItem('RENDER-COUNT', typeMap[type] || defaultCount) + } catch (e) {} + } } export const settingStorage = { - isShow () { - try { - return !!+(sessionStorage.getItem('SETTING-SHOW')) - } catch (e) { - return false - } - }, - - setShow (isShow) { - try { - sessionStorage.setItem('SETTING-SHOW', isShow ? 1 : 0) - } catch (e) {} + isShow () { + try { + return !!+(sessionStorage.getItem('SETTING-SHOW')) + } catch (e) { + return false } + }, + + setShow (isShow) { + try { + sessionStorage.setItem('SETTING-SHOW', isShow ? 1 : 0) + } catch (e) {} + } } export const reportPerformance = () => { - const initTime = window.app_init_time - const timeElement = document.getElementById('time') - if (timeElement && initTime) { - const timeWaste = Date.now() - initTime - timeElement.textContent = 'Build waste: ' + timeWaste + ' ms.' - } + const initTime = window.app_init_time + const timeElement = document.getElementById('time') + if (timeElement && initTime) { + const timeWaste = Date.now() - initTime + timeElement.textContent = 'Build waste: ' + timeWaste + ' ms.' + } - const memoryElement = document.getElementById('memory') - const performance = window.performance || window.webkitPerformance - if (memoryElement && performance && performance.memory && performance.memory.usedJSHeapSize) { - const memoryUsed = parseInt(performance.memory.usedJSHeapSize / (1024 * 1024)) - memoryElement.textContent = 'Memory used: ' + memoryUsed + ' MB.' - } + const memoryElement = document.getElementById('memory') + const performance = window.performance || window.webkitPerformance + if (memoryElement && performance && performance.memory && performance.memory.usedJSHeapSize) { + const memoryUsed = parseInt(performance.memory.usedJSHeapSize / (1024 * 1024)) + memoryElement.textContent = 'Memory used: ' + memoryUsed + ' MB.' + } } diff --git a/demos/demo.html b/demos/demo.html index d2c3dea..b7106f3 100644 --- a/demos/demo.html +++ b/demos/demo.html @@ -1,9 +1,9 @@ - - <%= htmlWebpackPlugin.options.title %> demo of vue-virtual-scroll-list - + + <%= htmlWebpackPlugin.options.title %> demo of vue-virtual-scroll-list +
diff --git a/demos/item-mode/App.vue b/demos/item-mode/App.vue index 4f66272..09de764 100644 --- a/demos/item-mode/App.vue +++ b/demos/item-mode/App.vue @@ -1,25 +1,25 @@ @@ -34,44 +34,44 @@ const itemCount = countStorage.get() let userInfoList = [] for (let i = 0; i < itemCount; i++) { - userInfoList.push(getRandomUser()) + userInfoList.push(getRandomUser()) } export default { - name: 'App', + name: 'App', - components: { - 'virtual-list': VirtualList - }, + components: { + 'virtual-list': VirtualList + }, + + data () { + return { + remain, + start: 0, + size: itemSize, + item: Item, + itemCount: itemCount + } + }, - data () { - return { - remain, - start: 0, - size: itemSize, - item: Item, - itemCount: itemCount + methods: { + getItemProps (itemIndex) { + return { + key: itemIndex, + props: { + height: itemSize, + index: itemIndex, + info: userInfoList[itemIndex] || {} } + } }, - methods: { - getItemProps (itemIndex) { - return { - key: itemIndex, - props: { - height: itemSize, - index: itemIndex, - info: userInfoList[itemIndex] || {} - } - } - }, - - onHeaderDataChange (type, value) { - if (type === 'start') { - this.start = value - } - } + onHeaderDataChange (type, value) { + if (type === 'start') { + this.start = value + } } + } } diff --git a/demos/item-mode/build.js b/demos/item-mode/build.js index 1eadf8b..edf3e48 100644 --- a/demos/item-mode/build.js +++ b/demos/item-mode/build.js @@ -9,5 +9,5 @@ var c={Handler:a,Random:i,Util:o,XHR:r,RE:s,toJSONSchema:l,valid:u,heredoc:o.her * Vue.js v2.6.10 * (c) 2014-2019 Evan You * Released under the MIT License. - */var r;r=function(){"use strict";var e=Object.freeze({});function r(e){return null==e}function a(e){return null!=e}function o(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function s(e){return null!==e&&"object"==typeof e}var l=Object.prototype.toString;function u(e){return l.call(e).slice(8,-1)}function c(e){return"[object Object]"===l.call(e)}function f(e){return"[object RegExp]"===l.call(e)}function p(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function d(e){return a(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function h(e){return null==e?"":Array.isArray(e)||c(e)&&e.toString===l?JSON.stringify(e,null,2):String(e)}function v(e){var t=parseFloat(e);return isNaN(t)?e:t}function m(e,t){for(var n=Object.create(null),r=e.split(","),a=0;a-1)return e.splice(n,1)}}var x=Object.prototype.hasOwnProperty;function _(e,t){return x.call(e,t)}function w(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var C=/-(\w)/g,k=w(function(e){return e.replace(C,function(e,t){return t?t.toUpperCase():""})}),A=w(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),S=/\B([A-Z])/g,$=w(function(e){return e.replace(S,"-$1").toLowerCase()}),T=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function E(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function O(e,t){for(var n in t)e[n]=t[n];return e}function R(e){for(var t={},n=0;n0,ee=X&&X.indexOf("edge/")>0,te=(X&&X.indexOf("android"),X&&/iphone|ipad|ipod|ios/.test(X)||"ios"===Y),ne=(X&&/chrome\/\d+/.test(X),X&&/phantomjs/.test(X),X&&X.match(/firefox\/(\d+)/)),re={}.watch,ae=!1;if(K)try{var oe={};Object.defineProperty(oe,"passive",{get:function(){ae=!0}}),window.addEventListener("test-passive",null,oe)}catch(e){}var ie=function(){return void 0===V&&(V=!K&&!J&&void 0!==t&&(t.process&&"server"===t.process.env.VUE_ENV)),V},se=K&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function le(e){return"function"==typeof e&&/native code/.test(e.toString())}var ue,ce="undefined"!=typeof Symbol&&le(Symbol)&&"undefined"!=typeof Reflect&&le(Reflect.ownKeys);ue="undefined"!=typeof Set&&le(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var fe=M,pe=M,de=M,he=M,ve="undefined"!=typeof console,me=/(?:^|[-_])(\w)/g;fe=function(e,t){var n=t?de(t):"";B.warnHandler?B.warnHandler.call(null,e,t,n):ve&&!B.silent&&console.error("[Vue warn]: "+e+n)},pe=function(e,t){ve&&!B.silent&&console.warn("[Vue tip]: "+e+(t?de(t):""))},he=function(e,t){if(e.$root===e)return"";var n="function"==typeof e&&null!=e.cid?e.options:e._isVue?e.$options||e.constructor.options:e,r=n.name||n._componentTag,a=n.__file;if(!r&&a){var o=a.match(/([^\/\\]+)\.vue$/);r=o&&o[1]}return(r?"<"+r.replace(me,function(e){return e.toUpperCase()}).replace(/[-_]/g,"")+">":"")+(a&&!1!==t?" at "+a:"")},de=function(e){if(e._isVue&&e.$parent){for(var t=[],n=0;e;){if(t.length>0){var r=t[t.length-1];if(r.constructor===e.constructor){n++,e=e.$parent;continue}n>0&&(t[t.length-1]=[r,n],n=0)}t.push(e),e=e.$parent}return"\n\nfound in\n\n"+t.map(function(e,t){return""+(0===t?"---\x3e ":function(e,t){for(var n="";t;)t%2==1&&(n+=e),t>1&&(e+=e),t>>=1;return n}(" ",5+2*t))+(Array.isArray(e)?he(e[0])+"... ("+e[1]+" recursive calls)":he(e))}).join("\n")}return"\n\n(found in "+he(e)+")"};var ge=0,ye=function(){this.id=ge++,this.subs=[]};ye.prototype.addSub=function(e){this.subs.push(e)},ye.prototype.removeSub=function(e){b(this.subs,e)},ye.prototype.depend=function(){ye.target&&ye.target.addDep(this)},ye.prototype.notify=function(){var e=this.subs.slice();B.async||e.sort(function(e,t){return e.id-t.id});for(var t=0,n=e.length;t-1)if(o&&!_(a,"default"))i=!1;else if(""===i||i===$(e)){var c=Ze(String,a.type);(c<0||l0&&(Dt((u=e(u,(n||"")+"_"+l))[0])&&Dt(f)&&(s[c]=Ae(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?Dt(f)?s[c]=Ae(f.text+u):""!==u&&s.push(Ae(u)):Dt(u)&&Dt(f)?s[c]=Ae(f.text+u.text):(o(t._isVList)&&a(u.tag)&&r(u.key)&&a(n)&&(u.key="__vlist"+n+"_"+l+"__"),s.push(u)));return s}(e):void 0}function Dt(e){return a(e)&&a(e.text)&&!1===e.isComment}function It(e,t){if(e){for(var n=Object.create(null),r=ce?Reflect.ownKeys(e):Object.keys(e),a=0;a0,i=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(i&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var l in a={},t)t[l]&&"$"!==l[0]&&(a[l]=Ft(n,l,t[l]))}else a={};for(var u in n)u in a||(a[u]=Ht(n,u));return t&&Object.isExtensible(t)&&(t._normalized=a),q(a,"$stable",i),q(a,"$key",s),q(a,"$hasNormal",o),a}function Ft(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:Pt(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function Ht(e,t){return function(){return e[t]}}function Bt(e,t){var n,r,o,i,l;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),r=0,o=e.length;rdocument.createEvent("Event").timeStamp&&(Nn=function(){return jn.now()})}function Fn(){var e,t;for(Ln=Nn(),Dn=!0,En.sort(function(e,t){return e.id-t.id}),In=0;InTn)){fe("You may have an infinite update loop "+(e.user?'in watcher with expression "'+e.expression+'"':"in a component render function."),e.vm);break}var n=On.slice(),r=En.slice();In=En.length=On.length=0,Rn={},Mn={},Pn=Dn=!1,function(e){for(var t=0;tIn&&En[n].id>e.id;)n--;En.splice(n+1,0,e)}else En.push(e);if(!Pn){if(Pn=!0,!B.async)return void Fn();mt(Fn)}}}(this)},Bn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||s(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){tt(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Bn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Bn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Bn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||b(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var zn={enumerable:!0,configurable:!0,get:M,set:M};function Un(e,t,n){zn.get=function(){return this[t][n]},zn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,zn)}function qn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},a=e.$options._propKeys=[],o=!e.$parent;o||Re(!1);var i=function(i){a.push(i);var s=Ge(i,t,n,e),l=$(i);(y(l)||B.isReservedAttr(l))&&fe('"'+l+'" is a reserved attribute and cannot be used as component prop.',e),De(r,i,s,function(){o||Cn||fe("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: \""+i+'"',e)}),i in e||Un(e,"_props",i)};for(var s in t)i(s);Re(!0)}(e,t.props),t.methods&&function(e,t){var n=e.$options.props;for(var r in t)"function"!=typeof t[r]&&fe('Method "'+r+'" has type "'+typeof t[r]+'" in the component definition. Did you reference the function correctly?',e),n&&_(n,r)&&fe('Method "'+r+'" has already been defined as a prop.',e),r in e&&U(r)&&fe('Method "'+r+'" conflicts with an existing Vue instance method. Avoid defining component methods that start with _ or $.'),e[r]="function"!=typeof t[r]?M:T(t[r],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;c(t=e._data="function"==typeof t?function(e,t){xe();try{return e.call(t,t)}catch(e){return tt(e,t,"data()"),{}}finally{_e()}}(t,e):t||{})||(t={},fe("data functions should return an object:\nhttps://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",e));var n=Object.keys(t),r=e.$options.props,a=e.$options.methods,o=n.length;for(;o--;){var i=n[o];a&&_(a,i)&&fe('Method "'+i+'" has already been defined as a data property.',e),r&&_(r,i)?fe('The data property "'+i+'" is already declared as a prop. Use prop default value instead.',e):U(i)||Un(e,"_data",i)}Pe(t,!0)}(e):Pe(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=ie();for(var a in t){var o=t[a],i="function"==typeof o?o:o.get;null==i&&fe('Getter is missing for computed property "'+a+'".',e),r||(n[a]=new Bn(e,i||M,M,Vn)),a in e?a in e.$data?fe('The computed property "'+a+'" is already defined in data.',e):e.$options.props&&a in e.$options.props&&fe('The computed property "'+a+'" is already defined as a prop.',e):Wn(e,a,o)}}(e,t.computed),t.watch&&t.watch!==re&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var a=0;a-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function nr(e,t){var n=e.cache,r=e.keys,a=e._vnode;for(var o in n){var i=n[o];if(i){var s=er(i.componentOptions);s&&!t(s)&&rr(n,o,r,a)}}}function rr(e,t,n,r){var a=e[t];!a||r&&a.tag===r.tag||a.componentInstance.$destroy(),e[t]=null,b(n,t)}!function(t){t.prototype._init=function(t){var n,r,a=this;a._uid=Yn++,B.performance&&it&&(n="vue-perf-start:"+a._uid,r="vue-perf-end:"+a._uid,it(n)),a._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var a=r.componentOptions;n.propsData=a.propsData,n._parentListeners=a.listeners,n._renderChildren=a.children,n._componentTag=a.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(a,t):a.$options=Ve(Xn(a.constructor),t||{},a),gt(a),a._self=a,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(a),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&_n(e,t)}(a),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,a=r&&r.context;t.$slots=Lt(n._renderChildren,a),t.$scopedSlots=e,t._c=function(e,n,r,a){return pn(t,e,n,r,a,!1)},t.$createElement=function(e,n,r,a){return pn(t,e,n,r,a,!0)};var o=r&&r.data;De(t,"$attrs",o&&o.attrs||e,function(){!Cn&&fe("$attrs is readonly.",t)},!0),De(t,"$listeners",n._parentListeners||e,function(){!Cn&&fe("$listeners is readonly.",t)},!0)}(a),$n(a,"beforeCreate"),function(e){var t=It(e.$options.inject,e);t&&(Re(!1),Object.keys(t).forEach(function(n){De(e,n,t[n],function(){fe('Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. injection being mutated: "'+n+'"',e)})}),Re(!0))}(a),qn(a),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(a),$n(a,"created"),B.performance&&it&&(a._name=he(a,!1),it(r),st("vue "+a._name+" init",n,r)),a.$options.el&&a.$mount(a.$options.el)}}(Zn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};t.set=function(){fe("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){fe("$props is readonly.",this)},Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Ie,e.prototype.$delete=Le,e.prototype.$watch=function(e,t,n){if(c(t))return Jn(this,e,t,n);(n=n||{}).user=!0;var r=new Bn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){tt(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(Zn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var a=0,o=e.length;a1?E(r):r;for(var a=E(arguments,1),o='event handler for "'+e+'"',i=0,s=r.length;iparseInt(this.max)&&rr(i,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return B},set:function(){fe("Do not replace the Vue.config object, set individual fields instead.")}};Object.defineProperty(e,"config",t),e.util={warn:fe,extend:O,mergeOptions:Ve,defineReactive:De},e.set=Ie,e.delete=Le,e.nextTick=mt,e.observable=function(e){return Pe(e),e},e.options=Object.create(null),F.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,O(e.options.components,or),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=E(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ve(this.options,e),this}}(e),Qn(e),function(e){F.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&Ue(e),"component"===t&&c(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(Zn),Object.defineProperty(Zn.prototype,"$isServer",{get:ie}),Object.defineProperty(Zn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Zn,"FunctionalRenderContext",{value:nn}),Zn.version="2.6.10";var ir=m("style,class"),sr=m("input,textarea,option,select,progress"),lr=function(e,t,n){return"value"===n&&sr(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},ur=m("contenteditable,draggable,spellcheck"),cr=m("events,caret,typing,plaintext-only"),fr=function(e,t){return mr(t)||"false"===t?"false":"contenteditable"===e&&cr(t)?t:"true"},pr=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),dr="http://www.w3.org/1999/xlink",hr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},vr=function(e){return hr(e)?e.slice(6,e.length):""},mr=function(e){return null==e||!1===e};function gr(e){for(var t=e.data,n=e,r=e;a(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=yr(r.data,t));for(;a(n=n.parent);)n&&n.data&&(t=yr(t,n.data));return function(e,t){if(a(e)||a(t))return br(e,xr(t));return""}(t.staticClass,t.class)}function yr(e,t){return{staticClass:br(e.staticClass,t.staticClass),class:a(e.class)?[e.class,t.class]:t.class}}function br(e,t){return e?t?e+" "+t:e:t||""}function xr(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,o=e.length;r-1?Vr(e,t,n):pr(t)?mr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):ur(t)?e.setAttribute(t,fr(t,n)):hr(t)?mr(n)?e.removeAttributeNS(dr,vr(t)):e.setAttributeNS(dr,t,n):Vr(e,t,n)}function Vr(e,t,n){if(mr(n))e.removeAttribute(t);else{if(Z&&!Q&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Wr={create:Ur,update:Ur};function Gr(e,t){var n=t.elm,o=t.data,i=e.data;if(!(r(o.staticClass)&&r(o.class)&&(r(i)||r(i.staticClass)&&r(i.class)))){var s=gr(t),l=n._transitionClasses;a(l)&&(s=br(s,xr(l))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Kr,Jr,Yr,Xr,Zr,Qr,ea,ta={create:Gr,update:Gr},na=/[\w).+\-_$\]]/;function ra(e){var t,n,r,a,o,i=!1,s=!1,l=!1,u=!1,c=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(v=e.charAt(h));h--);v&&na.test(v)||(u=!0)}}else void 0===a?(d=r+1,a=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===a?a=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,Xr),key:'"'+e.slice(Xr+1)+'"'}:{exp:e,key:null};Jr=e,Xr=Zr=Qr=0;for(;!_a();)wa(Yr=xa())?ka(Yr):91===Yr&&Ca(Yr);return{exp:e.slice(0,Zr),key:e.slice(Zr+1,Qr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function xa(){return Jr.charCodeAt(++Xr)}function _a(){return Xr>=Kr}function wa(e){return 34===e||39===e}function Ca(e){var t=1;for(Zr=Xr;!_a();)if(wa(e=xa()))ka(e);else if(91===e&&t++,93===e&&t--,0===t){Qr=Xr;break}}function ka(e){for(var t=e;!_a()&&(e=xa())!==t;);}var Aa,Sa="__r",$a="__c";function Ta(e,t,n){var r=Aa;return function a(){null!==t.apply(null,arguments)&&Ra(e,a,n,r)}}var Ea=lt&&!(ne&&Number(ne[1])<=53);function Oa(e,t,n,r){if(Ea){var a=Ln,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=a||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Aa.addEventListener(e,t,ae?{capture:n,passive:r}:n)}function Ra(e,t,n,r){(r||Aa).removeEventListener(e,t._wrapper||t,n)}function Ma(e,t){if(!r(e.data.on)||!r(t.data.on)){var n=t.data.on||{},o=e.data.on||{};Aa=t.elm,function(e){if(a(e[Sa])){var t=Z?"change":"input";e[t]=[].concat(e[Sa],e[t]||[]),delete e[Sa]}a(e[$a])&&(e.change=[].concat(e[$a],e.change||[]),delete e[$a])}(n),Ot(n,o,Oa,Ra,Ta,t.context),Aa=void 0}}var Pa,Da={create:Ma,update:Ma};function Ia(e,t){if(!r(e.data.domProps)||!r(t.data.domProps)){var n,o,i=t.elm,s=e.data.domProps||{},l=t.data.domProps||{};for(n in a(l.__ob__)&&(l=t.data.domProps=O({},l)),s)n in l||(i[n]="");for(n in l){if(o=l[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),o===s[n])continue;1===i.childNodes.length&&i.removeChild(i.childNodes[0])}if("value"===n&&"PROGRESS"!==i.tagName){i._value=o;var u=r(o)?"":String(o);La(i,u)&&(i.value=u)}else if("innerHTML"===n&&Cr(i.tagName)&&r(i.innerHTML)){(Pa=Pa||document.createElement("div")).innerHTML=""+o+"";for(var c=Pa.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;c.firstChild;)i.appendChild(c.firstChild)}else if(o!==s[n])try{i[n]=o}catch(e){}}}}function La(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(a(r)){if(r.number)return v(n)!==v(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var Na={create:Ia,update:Ia},ja=w(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Fa(e){var t=Ha(e.style);return e.staticStyle?O(e.staticStyle,t):t}function Ha(e){return Array.isArray(e)?R(e):"string"==typeof e?ja(e):e}var Ba,za=/^--/,Ua=/\s*!important$/,qa=function(e,t,n){if(za.test(t))e.style.setProperty(t,n);else if(Ua.test(n))e.style.setProperty($(t),n.replace(Ua,""),"important");else{var r=Wa(t);if(Array.isArray(n))for(var a=0,o=n.length;a-1?t.split(Ja).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Xa(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Ja).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function Za(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&O(t,Qa(e.name||"v")),O(t,e),t}return"string"==typeof e?Qa(e):void 0}}var Qa=w(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),eo=K&&!Q,to="transition",no="animation",ro="transition",ao="transitionend",oo="animation",io="animationend";eo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ro="WebkitTransition",ao="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(oo="WebkitAnimation",io="webkitAnimationEnd"));var so=K?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function lo(e){so(function(){so(e)})}function uo(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Ya(e,t))}function co(e,t){e._transitionClasses&&b(e._transitionClasses,t),Xa(e,t)}function fo(e,t,n){var r=ho(e,t),a=r.type,o=r.timeout,i=r.propCount;if(!a)return n();var s=a===to?ao:io,l=0,u=function(){e.removeEventListener(s,c),n()},c=function(t){t.target===e&&++l>=i&&u()};setTimeout(function(){l0&&(n=to,c=i,f=o.length):t===no?u>0&&(n=no,c=u,f=l.length):f=(n=(c=Math.max(i,u))>0?i>u?to:no:null)?n===to?o.length:l.length:0,{type:n,timeout:c,propCount:f,hasTransform:n===to&&po.test(r[ro+"Property"])}}function vo(e,t){for(;e.length explicit "+t+" duration is not a valid number - got "+JSON.stringify(e)+".",n.context):isNaN(e)&&fe(" explicit "+t+" duration is NaN - the duration expression might be incorrect.",n.context)}function xo(e){return"number"==typeof e&&!isNaN(e)}function _o(e){if(r(e))return!1;var t=e.fns;return a(t)?_o(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function wo(e,t){!0!==t.data.show&&go(t)}var Co=function(e){var t,n,s={},l=e.modules,u=e.nodeOps;for(t=0;t - did you register the component correctly? For recursive components, make sure to provide the "name" option.',e.context),e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),_(e),y(e,h,t),a(f)&&x(e,t),g(n,e.elm,r),f&&f.pre&&d--):o(e.isComment)?(e.elm=u.createComment(e.text),g(n,e.elm,r)):(e.elm=u.createTextNode(e.text),g(n,e.elm,r))}}function v(e,t){a(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,b(e)?(x(e,t),_(e)):(Rr(e),t.push(e))}function g(e,t,n){a(e)&&(a(n)?u.parentNode(n)===e&&u.insertBefore(e,t,n):u.appendChild(e,t))}function y(e,t,n){if(Array.isArray(t)){S(t);for(var r=0;rd?w(e,r(n[g+1])?null:n[g+1].elm,n,p,g,o):p>g&&k(0,t,f,d)}(f,v,m,n,c):a(m)?(S(m),a(e.text)&&u.setTextContent(f,""),w(f,null,m,0,m.length-1,n)):a(v)?k(0,v,0,v.length-1):a(e.text)&&u.setTextContent(f,""):e.text!==t.text&&u.setTextContent(f,t.text),a(d)&&a(p=d.hook)&&a(p=p.postpatch)&&p(e,t)}}}function E(e,t,n){if(o(n)&&a(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r, or missing . Bailing hydration and performing full client-side render.")}l=e,e=new we(u.tagName(l).toLowerCase(),{},[],void 0,l)}var d=e.elm,v=u.parentNode(d);if(h(t,f,d._leaveCb?null:v,u.nextSibling(d)),a(t.parent))for(var m=t.parent,g=b(t);m;){for(var y=0;y-1,i.selected!==o&&(i.selected=o);else if(I(To(i),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));a||(e.selectedIndex=-1)}else fe('