Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: chandrunaik/vue-virtual-scroll-list
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: tangbc/vue-virtual-scroll-list
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on May 10, 2020

  1. Fix typo

    chandrunaik authored and tangbc committed May 10, 2020
    Copy the full SHA
    ecd2331 View commit details

Commits on May 14, 2020

  1. Fix props type warning tangbc#211

    tangbc committed May 14, 2020
    Copy the full SHA
    cf4d0c7 View commit details
  2. Release v2.2.2

    tangbc committed May 14, 2020
    Copy the full SHA
    ba2ca7a View commit details
  3. Copy the full SHA
    72e875d View commit details
  4. Release v2.2.3

    tangbc committed May 14, 2020
    Copy the full SHA
    2842e8f View commit details

Commits on May 15, 2020

  1. Update readme

    tangbc committed May 15, 2020
    Copy the full SHA
    0ebea64 View commit details

Commits on May 22, 2020

  1. for item component

    gr8den authored and tangbc committed May 22, 2020
    Copy the full SHA
    3b5e7e4 View commit details
  2. code style fix

    gr8den authored and tangbc committed May 22, 2020
    Copy the full SHA
    b0b0411 View commit details

Commits on May 23, 2020

  1. Change to itemScopedSlots

    tangbc committed May 23, 2020
    Copy the full SHA
    fe50aba View commit details

Commits on May 28, 2020

  1. add key for rendering items

    it will increase speed of VNode-Dom comparison and patch
    for example for list of images when new slots added to the list only these images will requested (at this moment all 30 will be requested)
    linniksa authored and tangbc committed May 28, 2020
    Copy the full SHA
    1eb52b0 View commit details
  2. Copy the full SHA
    2a90506 View commit details
  3. Release v2.2.4

    tangbc committed May 28, 2020
    Copy the full SHA
    ec7f5e9 View commit details
  4. Build docs

    tangbc committed May 28, 2020
    Copy the full SHA
    b0263d8 View commit details
  5. Copy the full SHA
    950cb6a View commit details
  6. Release v2.2.5

    tangbc committed May 28, 2020
    Copy the full SHA
    d7dedb6 View commit details
  7. Build docs

    tangbc committed May 28, 2020
    Copy the full SHA
    33eda19 View commit details

Commits on May 31, 2020

  1. Use key in item component

    tangbc committed May 31, 2020
    Copy the full SHA
    fd24e0a View commit details
  2. Release v2.2.6

    tangbc committed May 31, 2020
    Copy the full SHA
    b3fea35 View commit details
  3. Build docs

    tangbc committed May 31, 2020
    Copy the full SHA
    481319b View commit details
  4. Update readme

    tangbc committed May 31, 2020
    Copy the full SHA
    2cf1c29 View commit details

Commits on Jun 8, 2020

  1. Copy the full SHA
    a71fedb View commit details

Commits on Jun 9, 2020

  1. Copy the full SHA
    7f38b8c View commit details
  2. Update README.md

    aisin authored and tangbc committed Jun 9, 2020
    Copy the full SHA
    b491d0c View commit details
  3. Copy the full SHA
    47bff8f View commit details
  4. Release v2.2.7

    tangbc committed Jun 9, 2020
    Copy the full SHA
    40db688 View commit details
  5. Build docs

    tangbc committed Jun 9, 2020
    Copy the full SHA
    10d4609 View commit details
  6. Update readme

    tangbc committed Jun 9, 2020
    Copy the full SHA
    f8c6a76 View commit details

Commits on Jun 10, 2020

  1. Copy the full SHA
    67a796b View commit details
  2. Copy the full SHA
    f706df4 View commit details
  3. Release v2.2.8

    tangbc committed Jun 10, 2020
    Copy the full SHA
    2496d77 View commit details
  4. Build docs

    tangbc committed Jun 10, 2020
    Copy the full SHA
    b80943d View commit details
  5. Copy the full SHA
    9aaea8d View commit details
  6. Fix tangbc#206

    tangbc committed Jun 10, 2020
    Copy the full SHA
    eb22df7 View commit details
  7. Release v2.2.9

    tangbc committed Jun 10, 2020
    Copy the full SHA
    b83b3a0 View commit details
  8. Build docs

    tangbc committed Jun 10, 2020
    Copy the full SHA
    deab720 View commit details

Commits on Jun 19, 2020

  1. Fix tangbc#242

    tangbc committed Jun 19, 2020
    Copy the full SHA
    deec9b6 View commit details
  2. Release v2.3.0

    tangbc committed Jun 19, 2020
    Copy the full SHA
    e102427 View commit details
  3. Build docs

    tangbc committed Jun 19, 2020
    Copy the full SHA
    0ca6822 View commit details

Commits on Jul 17, 2020

  1. Bump lodash from 4.17.15 to 4.17.19

    Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
    - [Release notes](https://github.com/lodash/lodash/releases)
    - [Commits](lodash/lodash@4.17.15...4.17.19)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and tangbc committed Jul 17, 2020
    Copy the full SHA
    abe44e5 View commit details
  2. Bump lodash from 4.17.15 to 4.17.19 in /example

    Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
    - [Release notes](https://github.com/lodash/lodash/releases)
    - [Commits](lodash/lodash@4.17.15...4.17.19)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and tangbc committed Jul 17, 2020
    Copy the full SHA
    36d00bd View commit details

Commits on Jul 23, 2020

  1. Response to update when keeps changes

    aisin authored and tangbc committed Jul 23, 2020
    Copy the full SHA
    a41aae0 View commit details

Commits on Jul 24, 2020

  1. Fix tangbc#247

    tangbc committed Jul 24, 2020
    Copy the full SHA
    b7e581b View commit details
  2. Release v2.3.1

    tangbc committed Jul 24, 2020
    Copy the full SHA
    1c9f60a View commit details
  3. Build docs

    tangbc committed Jul 24, 2020
    Copy the full SHA
    7b147e0 View commit details

Commits on Aug 7, 2020

  1. Change param detecting.

    tangbc committed Aug 7, 2020
    Copy the full SHA
    df29452 View commit details

Commits on Sep 11, 2020

  1. Copy the full SHA
    b9fa428 View commit details

Commits on Nov 25, 2020

  1. Calculate correct average size

    firstRangeAverageSize is calculated wrong when the first items of the first range have the same size and the following a different size.
    punkt2 authored and tangbc committed Nov 25, 2020
    Copy the full SHA
    dbd4bf7 View commit details
  2. Release v2.3.2

    tangbc committed Nov 25, 2020
    Copy the full SHA
    9937db0 View commit details
  3. Build docs

    tangbc committed Nov 25, 2020
    Copy the full SHA
    2ef187e View commit details

Commits on Feb 7, 2021

  1. Update readme

    tangbc committed Feb 7, 2021
    Copy the full SHA
    4df0044 View commit details
51 changes: 23 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
<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"/>
<img alt="CIStatus" 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 href="https://npm-stat.com/charts.html?package=vue-virtual-scroll-list">
<img alt="Downloads" src="https://img.shields.io/npm/dm/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"/>
<img alt="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="http://packagequality.com/#?package=vue-virtual-scroll-list">
<img alt="Package quality" src="https://npm.packagequality.com/shield/vue-virtual-scroll-list.svg">
<img alt="Quality" src="https://npm.packagequality.com/shield/vue-virtual-scroll-list.svg">
</a>
</p>

## Table of contents

* [Advantages](#advantages)
* [Live demo](#live-demo)
* [What's new in v2.0](#whats-new-in-v20)
* [Simple usage](#simple-usage)
* [**Props type**](#props-type)
* [Required props](#required-props)
@@ -48,13 +47,6 @@ https://tangbc.github.io/vue-virtual-scroll-list
https://codesandbox.io/s/live-demo-virtual-list-e1ww1


## What's new in v2.0

Here are the major of update informations with [release v2.0](https://github.com/tangbc/vue-virtual-scroll-list/releases/tag/v2.0.0).

Since the `v2.0` is **not compatible** with `v1.x`, please note before upgrading, `v1.x` documentation see [v1.x.md](https://github.com/tangbc/vue-virtual-scroll-list/blob/master/v1.x.md).


## Simple usage

```bash
@@ -69,7 +61,6 @@ Root component:
:data-key="'uid'"
:data-sources="items"
:data-component="itemComponent"
:extra-props="{ otherPropValue: otherDataAssginToItemComponet }"
/>
</div>
</template>
@@ -83,8 +74,7 @@ Root component:
data () {
return {
itemComponent: Item,
items: [{uid: 'unique_1', text: 'abc'}, {uid: 'unique_2', text: 'xyz'}, ...],
otherDataAssginToItemComponet: 'The Progressive JavaScript Framework'
items: [{uid: 'unique_1', text: 'abc'}, {uid: 'unique_2', text: 'xyz'}, ...]
}
},
components: { 'virtual-list': VirtualList }
@@ -95,7 +85,7 @@ Root component:
Item component:
```vue
<template>
<div>{{ index }} - {{ source.text }} - {{ otherPropValue }}</div>
<div>{{ index }} - {{ source.text }}</div>
</template>
<script>
@@ -110,8 +100,7 @@ Item component:
default () {
return {}
}
},
otherPropValue: String // here is: 'The Progressive JavaScript Framework'
}
}
}
</script>
@@ -124,11 +113,11 @@ More usages or getting start you can refer to these clearly [examples](https://g

### Required props

| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;** | **Type** | **Description** |
|------------------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| `data-key` | String | The unique key get from `data-sources` in each data object, its value **must be unique** in `data-sources`, it is used for identifying item size. |
| `data-sources` | Array[Object] | The source array built for list, each array data must be an object and has an unique key for `data-key` property. |
| `data-component` | Component | The render item component created / declared by vue, and it will use the data object in `datas-sources` as render prop and named: `source`. |
| **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;** | **Type** | **Description** |
|------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `data-key` | String\|Function | The unique key get from `data-sources` in each data object. Or a function called with each `data-source` and return their unique key. Its value **must be unique** in `data-sources`, it is used for identifying item size. |
| `data-sources` | Array[Object] | The source array built for list, each array data must be an object and has an unique key get or generate for `data-key` property. |
| `data-component` | Component | The render item component created / declared by vue, and it will use the data object in `data-sources` as render prop and named: `source`. |

### Optional props

@@ -137,7 +126,7 @@ More usages or getting start you can refer to these clearly [examples](https://g
<p></p>
<table>
<tr>
<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Props&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
@@ -158,7 +147,7 @@ More usages or getting start you can refer to these clearly [examples](https://g
<td><code>estimate-size</code></td>
<td>Number</td>
<td>50</td>
<td>The estimate size of each item, if it is closer to the average size, the scrollbar length looks more accurately. It is recommended to assign the average that calculate by yourself.</td>
<td>The estimate size of each item, if it is closer to the average size, the scrollbar length looks more accurately. It is <strong>recommended</strong> to assign the average that calculate by yourself.</td>
</tr>
</table>
</details>
@@ -168,7 +157,7 @@ More usages or getting start you can refer to these clearly [examples](https://g
<p></p>
<table>
<tr>
<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Props&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
@@ -281,6 +270,12 @@ More usages or getting start you can refer to these clearly [examples](https://g
<td>{}</td>
<td>Item wrapper element inline style.</td>
</tr>
<tr>
<td><code>item-scoped-slots</code></td>
<td>Object</td>
<td>{}</td>
<td>The <code>$scopedSlots</code> for item component.</td>
</tr>
<tr>
<td><code>header-tag</code></td>
<td>String</td>
@@ -379,7 +374,7 @@ More usages or getting start you can refer to these clearly [examples](https://g

This component use an `in-place patch` strategy to render list instead of `v-for` and `:key`. This way achieves the best efficient, but only suitable when your list output does not rely on item component inner state or temporary DOM state (e.g. form input values).

But how to deal with such a situation? Without maintaining inner state, recommend to use props and dispatch (stateless component), here is an example [keep-state](https://tangbc.github.com/vue-virtual-scroll-list/#/keep-state).
But how to deal with such a situation? Without maintaining inner state, recommend to use props and dispatch (stateless component), here is an example [keep-state](https://tangbc.github.io/vue-virtual-scroll-list/#/keep-state).


## Contributions
Loading