Skip to content

Commit

Permalink
Eslint --fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
tangbc committed Aug 21, 2019
1 parent 1c26543 commit b2e7226
Show file tree
Hide file tree
Showing 47 changed files with 2,657 additions and 2,648 deletions.
6 changes: 3 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": [
["@babel/preset-env"]
]
"presets": [
["@babel/preset-env"]
]
}
71 changes: 35 additions & 36 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -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
}
}]
}
}
"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
}
}]
}
}
148 changes: 74 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<p>
<a href="https://travis-ci.org/tangbc/vue-virtual-scroll-list">
<img alt="Travis CI Status" src="https://travis-ci.org/tangbc/vue-virtual-scroll-list.svg?branch=master"/>
</a>
<a href="https://codecov.io/gh/tangbc/vue-virtual-scroll-list">
<img alt="Code Coverage" src="https://codecov.io/gh/tangbc/vue-virtual-scroll-list/branch/master/graph/badge.svg"/>
</a>
<a href="https://npmjs.com/package/vue-virtual-scroll-list">
<img alt="NPM downloads" src="https://img.shields.io/npm/dm/vue-virtual-scroll-list.svg">
</a>
<a href="http://packagequality.com/#?package=vue-virtual-scroll-list">
<img alt="Package quality" src="https://npm.packagequality.com/shield/vue-virtual-scroll-list.svg">
</a>
<a href="https://npmjs.com/package/vue-virtual-scroll-list">
<img alt="NPM version" src="https://img.shields.io/npm/v/vue-virtual-scroll-list.svg"/>
</a>
<a href="https://vuejs.org/">
<img alt="Vue version" src="https://img.shields.io/badge/vue-%3E=2.3.0-brightgreen.svg"/>
</a>
<a href="https://opensource.org/licenses/MIT">
<img alt="License" src="https://img.shields.io/npm/l/vue-virtual-scroll-list.svg">
</a>
<a href="https://travis-ci.org/tangbc/vue-virtual-scroll-list">
<img alt="Travis CI Status" src="https://travis-ci.org/tangbc/vue-virtual-scroll-list.svg?branch=master"/>
</a>
<a href="https://codecov.io/gh/tangbc/vue-virtual-scroll-list">
<img alt="Code Coverage" src="https://codecov.io/gh/tangbc/vue-virtual-scroll-list/branch/master/graph/badge.svg"/>
</a>
<a href="https://npmjs.com/package/vue-virtual-scroll-list">
<img alt="NPM downloads" src="https://img.shields.io/npm/dm/vue-virtual-scroll-list.svg">
</a>
<a href="http://packagequality.com/#?package=vue-virtual-scroll-list">
<img alt="Package quality" src="https://npm.packagequality.com/shield/vue-virtual-scroll-list.svg">
</a>
<a href="https://npmjs.com/package/vue-virtual-scroll-list">
<img alt="NPM version" src="https://img.shields.io/npm/v/vue-virtual-scroll-list.svg"/>
</a>
<a href="https://vuejs.org/">
<img alt="Vue version" src="https://img.shields.io/badge/vue-%3E=2.3.0-brightgreen.svg"/>
</a>
<a href="https://opensource.org/licenses/MIT">
<img alt="License" src="https://img.shields.io/npm/l/vue-virtual-scroll-list.svg">
</a>
</p>

## Table of contents
Expand All @@ -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)
Expand Down Expand Up @@ -80,23 +80,23 @@ All you need to care about is only data!

```vue
<template>
<div>
<virtual-list :size="40" :remain="8">
<item v-for="item of items" :key="item.id" />
</virtual-list>
</div>
<div>
<virtual-list :size="40" :remain="8">
<item v-for="item of items" :key="item.id" />
</virtual-list>
</div>
</template>
<script>
import item from '../item.vue'
import virtualList from 'vue-virtual-scroll-list'
export default {
data () {
return {
items: [ {id: 1}, {id: 2}, {id: 3}, ... ]
}
},
components: { item, 'virtual-list': virtualList }
}
import item from '../item.vue'
import virtualList from 'vue-virtual-scroll-list'
export default {
data () {
return {
items: [ {id: 1}, {id: 2}, {id: 3}, ... ]
}
},
components: { item, 'virtual-list': virtualList }
}
</script>
```

Expand All @@ -106,36 +106,36 @@ This mode can save a considerable amount of memory and performance. Props `item`

```vue
<template>
<div>
<virtual-list :size="40" :remain="8"
:item="item"
:itemcount="100000"
:itemprops="getItemprops"
/>
</div>
<div>
<virtual-list :size="40" :remain="8"
:item="item"
:itemcount="100000"
:itemprops="getItemprops"
/>
</div>
</template>
<script>
import itemComponent from '../item.vue'
import virtualList from 'vue-virtual-scroll-list'
export default {
data () {
return {
item: itemComponent,
}
},
methods: {
getItemprops (itemIndex) {
// <item/> will render with following data object:
// https://vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth
return {
props: itemProps,
attrs: itemAttrs,
...
}
}
},
components: { 'virtual-list': virtualList }
}
import itemComponent from '../item.vue'
import virtualList from 'vue-virtual-scroll-list'
export default {
data () {
return {
item: itemComponent,
}
},
methods: {
getItemprops (itemIndex) {
// <item/> will render with following data object:
// https://vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth
return {
props: itemProps,
attrs: itemAttrs,
...
}
}
},
components: { 'virtual-list': virtualList }
}
</script>
```
Expand All @@ -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 `<item/>` component, you **must** set inline style height on `<item/>` component outside directly, such as:
```vue
<template>
<div>
<virtual-list :size="40" :remain="8" :variable="true">
<item v-for="item of items" :key="item.id" :style="{ height: item.height + 'px' }" />
</virtual-list>
</div>
<div>
<virtual-list :size="40" :remain="8" :variable="true">
<item v-for="item of items" :key="item.id" :style="{ height: item.height + 'px' }" />
</virtual-list>
</div>
</template>
```

Expand Down
42 changes: 21 additions & 21 deletions demos/common/Corner.vue
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<template>
<a :href="url" class="github-corner" aria-label="View source on GitHub">
<svg :width="size" :height="size" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0; z-index: 1000;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" />
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" style="transform-origin: 130px 106px;" fill="currentColor" class="octo-arm" />
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body" />
</svg>
<svg :width="size" :height="size" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0; z-index: 1000;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" />
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" style="transform-origin: 130px 106px;" fill="currentColor" class="octo-arm" />
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body" />
</svg>
</a>
</template>

<script>
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 || '')
}
}
}
</script>

Expand Down
Loading

0 comments on commit b2e7226

Please sign in to comment.