Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
7fc854f
Always render all slots
themeler Aug 16, 2018
62b2435
Release version 1.2.8
tangbc Aug 16, 2018
76c323d
$refs.vsl can be a component
andriepu Dec 18, 2018
7352b73
remove semicolon
andriepu Dec 21, 2018
f5a4993
Improving scroll performance in in latest vue version. #72
tangbc Dec 29, 2018
392c96f
Update example.
tangbc Dec 29, 2018
42be377
Version 1.2.9
tangbc Dec 29, 2018
6f238bf
Version 1.3.0: no es2015
tangbc Dec 29, 2018
c138fed
Update eslint rule.
tangbc Jan 3, 2019
f2f3377
Update shields icon.
tangbc Jan 3, 2019
7a6494d
Update readme.
tangbc Jan 9, 2019
4690cb8
Update readme
tangbc Jan 17, 2019
3bc5a43
[Fix] $slots children references cause memory leak, replace by creati…
imwtr Feb 23, 2019
2393631
Merge branch 'imwtr-memory-saving'
tangbc Mar 2, 2019
babf33d
fix some problem in item-mode
tangbc Mar 3, 2019
7343f19
Remove unnecessary padding bottom when decimal number is used
andriepu Mar 2, 2019
b1b72fe
Ensure start and end is right before render. #88
tangbc Mar 8, 2019
39f86ff
Update reade me
tangbc Mar 8, 2019
f8da8d6
Version 1.3.1
tangbc Mar 9, 2019
6638ebc
Update readme
tangbc Mar 9, 2019
a6cc82a
Update examples.
tangbc Mar 9, 2019
751f1e4
use itemcount instead of itemarray
tangbc Mar 18, 2019
d7334ce
Make itemcount reactive.
tangbc Mar 19, 2019
18e0d91
Update new demos folder.
tangbc Mar 22, 2019
dee5e5d
Update demos webpack
tangbc Mar 23, 2019
9a8a499
Update demos
tangbc Mar 23, 2019
c6596b6
Update demos
tangbc Mar 23, 2019
b313a0f
Update demos.
tangbc Mar 23, 2019
5af33ef
Change `itemprop` to `itemprops`
tangbc Mar 23, 2019
990dc4e
Update demos with media query.
tangbc Mar 23, 2019
58c8913
Add variable mode demo.
tangbc Mar 23, 2019
bca9092
Update variable demo.
tangbc Mar 23, 2019
ed62a71
Update readme.
tangbc Mar 23, 2019
d237444
Fixed variable demo link error.
tangbc Mar 23, 2019
8424a11
Version 1.3.2
tangbc Mar 23, 2019
ef45dd0
Update demos.
tangbc Mar 24, 2019
b6ef714
Disable user-scalable.
tangbc Mar 24, 2019
9b1458d
Update item component.
tangbc Mar 25, 2019
a56b36f
Update demo user-select.
tangbc Mar 25, 2019
76f4335
Demo disable avatar default.
tangbc Mar 26, 2019
aeaf194
Update dev server.
tangbc Mar 30, 2019
3d16a0b
Update dev server version.
tangbc Mar 31, 2019
2ed47bc
Update and add test cover.
tangbc Apr 5, 2019
9befd8b
Add unit tests.
tangbc Apr 5, 2019
481bdee
Add travis-ci.
tangbc Apr 5, 2019
05c95a6
Update travis.
tangbc Apr 5, 2019
bca43e8
Version sync.
tangbc Apr 5, 2019
fdaade4
Update ci script.
tangbc Apr 5, 2019
40be8c6
Config coverage path.
tangbc Apr 5, 2019
0d63b66
Add lcov type.
tangbc Apr 5, 2019
41b479c
Update ci status badges.
tangbc Apr 5, 2019
886b937
Update script.
tangbc Apr 5, 2019
ccc2e03
Force render next zone then overs is going to reach last item. #91
tangbc Apr 6, 2019
85e6329
Remove check zone in filter function, use forceRender instead.
tangbc Apr 6, 2019
7473755
Change function name.
tangbc Apr 6, 2019
a956917
Decrease scroll overs when scroll up.
tangbc Apr 6, 2019
9d9fa5c
Add without-virtual-list to compare experience.
tangbc Apr 6, 2019
72ec3b7
Version 1.3.3
tangbc Apr 6, 2019
361ede0
Update demos.
tangbc Apr 7, 2019
8230c12
Update demo report.
tangbc Apr 7, 2019
c368549
Update readme.
tangbc Apr 7, 2019
0aa26fe
Update.
tangbc Apr 7, 2019
454016c
Update grid structure.
tangbc Apr 8, 2019
d0e4f1a
Add info tips.
tangbc Apr 9, 2019
5689be0
Add group role to list item wrapper
Apr 14, 2019
95b0e6f
Add group role for aria usage
Mash19 Apr 14, 2019
c8a9c2d
merge
Apr 16, 2019
484c4f8
Undo editor format on save changes
Apr 17, 2019
1161ef9
Merge branch 'Mash19-master'
tangbc Apr 17, 2019
e0209fd
Fixe render over in item-mode. #96
tangbc Apr 18, 2019
5fd410e
Demo build.
tangbc Apr 18, 2019
52aa306
Version 1.3.4
tangbc Apr 18, 2019
b30bfc0
correct render function to add role attribute
Apr 17, 2019
2e76c24
Update setsize source in test
Apr 19, 2019
6aa17bc
fix lint errors
Apr 19, 2019
8c472f0
Corrected listitem role.
Apr 19, 2019
2af4c25
Use es6 and eslint vue rules.
tangbc Apr 20, 2019
49f2976
All use eslint code style.
tangbc Apr 20, 2019
c0ee3c4
Move eslintIgnore into package.json
tangbc Apr 20, 2019
9f37f21
Update version
tangbc Apr 20, 2019
fabcd13
Fixed missing entry file in npm.
tangbc Apr 20, 2019
67dd17d
Fixed incorrect length of real DOM items for item mode
n5leon Apr 26, 2019
c01edaf
Update demo bench.
tangbc Apr 27, 2019
c43ca8e
Update
tangbc Apr 27, 2019
a31f1c2
Update item mode total less than keeps.
tangbc Apr 27, 2019
fa14f6e
Update
tangbc Apr 28, 2019
458d4cc
Update version
tangbc Apr 28, 2019
b55bd6d
Version
tangbc Apr 28, 2019
185cfc6
Update readme.
tangbc Apr 29, 2019
bd79a3d
Update test.
tangbc Apr 29, 2019
eb7450e
Update readme
tangbc May 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": [
["env", { "modules": false }]
["@babel/preset-env"]
]
}
}
27 changes: 22 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
{
"extends": "standard",
"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],
// allow paren-less arrow functions
"arrow-parens": 0,
// allow async-await
"generator-star-spacing": 0,
// disallow trailing whitespace at the end of lines
"no-trailing-spaces": [0, { "skipBlankLines": true }]
"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
}
}]
}
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
dev
node_modules
npm-debug.log
examples/**/*.map
coverage
demos/dev/
demos/dev*/
demos/**/*.map
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js
node_js:
- 8
script:
- npm run ci
branches:
only:
- master
after_success:
- bash <(curl -s https://codecov.io/bash)
244 changes: 161 additions & 83 deletions README.md

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions demos/common/Corner.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<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>
</a>
</template>

<script>
import { isMobile } from './util'

export default {
name: 'GithubCorner',

props: {
path: {
type: String,
default: ''
}
},

data () {
return {
size: isMobile ? 40 : 80
}
},

computed: {
url () {
return `https://github.com/tangbc/vue-virtual-scroll-list/tree/master/demos` + (this.path || '')
}
}
}
</script>

<style>
.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}
</style>
249 changes: 249 additions & 0 deletions demos/common/Header.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
<template>
<header :class="warning ? 'warning': ''">
<h1>{{ title }}</h1>
<section>
<span class="desciption">{{ desciption }}</span>
<span id="time" class="performance time" />
<span id="memory" class="performance memory" />
<div class="icon" :class="showSetting ? 'active' : ''" @click="clickIcon">
<svg width="25" height="25" t="1553394278598" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8690" xmlns:xlink="http://www.w3.org/1999/xlink">
<path d="M809.21 474.749H374.022c-19.865 0-35.966 16.101-35.966 35.966 0 19.859 16.101 35.966 35.966 35.966H809.21c19.865 0 35.966-16.107 35.966-35.966 0-19.864-16.101-35.966-35.966-35.966m0 215.796H374.022c-19.865 0-35.966 16.101-35.966 35.966 0 19.859 16.101 35.966 35.966 35.966H809.21c19.865 0 35.966-16.107 35.966-35.966 0-19.865-16.101-35.966-35.966-35.966M220.52 258.954c-19.865 0-35.966 16.101-35.966 35.966 0 19.865 16.101 35.966 35.966 35.966s35.966-16.101 35.966-35.966c0-19.865-16.102-35.966-35.966-35.966m153.502 71.932H809.21c19.865 0 35.966-16.101 35.966-35.966 0-19.865-16.101-35.966-35.966-35.966H374.022c-19.865 0-35.966 16.101-35.966 35.966 0 19.864 16.102 35.966 35.966 35.966M220.52 474.749c-19.865 0-35.966 16.101-35.966 35.966 0 19.859 16.101 35.966 35.966 35.966s35.966-16.107 35.966-35.966c0-19.864-16.102-35.966-35.966-35.966m0 215.796c-19.865 0-35.966 16.101-35.966 35.966 0 19.859 16.101 35.966 35.966 35.966s35.966-16.107 35.966-35.966c0-19.865-16.102-35.966-35.966-35.966" p-id="8691" fill="#2c2c2c" />
</svg>
</div>
<div v-show="showSetting" class="setting">
<div v-if="showStart" class="option">
<span v-if="isMobile" class="name">Index:</span>
<span v-else class="name">Start index:</span>
<input v-model="selfStartIndex" type="text"
@focus="$event.target.select()"
@input="inputDataChange('start', $event.target.value)"
>
</div>

<div class="option">
<span v-if="isMobile" class="name">Count:</span>
<span v-else class="name">List count:</span>
<label>
<input v-model="renderCount" type="radio" value="1">
<span class="t1">1,000</span>
</label>
<label class="middle">
<input v-model="renderCount" type="radio" value="2">
<span class="t2">10,000</span>
</label>
<label>
<input v-model="renderCount" type="radio" value="3">
<span class="t3">100,000</span>
</label>
</div>
</div>
</section>
</header>
</template>

<script>
import { isMobile, debounce, countStorage, settingStorage } from './util'

export default {
name: 'AppHeader',

props: {
warning: Boolean,
title: {
type: String,
default: ''
},
desciption: {
type: String,
default: ''
},
startIndex: {
type: Number,
default: 0
},
onDataChange: {
type: Function,
default: () => {}
}
},

data () {
return {
isMobile,
selfStartIndex: 0,
showSetting: settingStorage.isShow(),
renderCount: String(countStorage.get()).length - 3
}
},

computed: {
showStart () {
return this.startIndex !== undefined
},

isRenderSetting () {
return this.showSetting && (this.showStart)
}
},

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

<style lang="less">
header {
font-family: monospace;
h1 {
padding: 20px 0;
@media (max-width: 640px) {
padding: 10px 0;
font-size: 24px;
}
}
section {
font-size: 14px;
background: #f7f7f7;
padding: 10px;
margin-bottom: 20px;
border-radius: 5px;
position: relative;
.performance {
color: #ee82ee;
position: absolute;
right: 50px;
font-size: 12px;
@media (max-width: 640px) {
display: block;
position: relative;
right: 0;
padding-top: 5px;
}
}
.memory {
top: 18px;
@media (max-width: 640px) {
display: block;
position: relative;
right: 0;
padding-top: 5px;
top: 0;
}
}
.time {
top: 5px;
}
.icon {
width: 25px;
height: 25px;
line-height: 25px;
text-align: center;
position: absolute;
right: 10px;
top: 5px;
cursor: pointer;
border-radius: 3px;
&.active {
background-color: #c0c0c0;
}
}
.setting {
position: relative;
padding: 30px 0 20px 20px;
@media (max-width: 640px) {
padding: 20px 0 20px 0px;
}
.option {
display: block;
margin-bottom: 20px;
&:last-child {
margin: 0;
}
.name {
font-family: 'Courier New', Courier, monospace;
font-weight: bold;
display: inline-block;
min-width: 120px;
text-align: left;
@media (max-width: 640px) {
min-width: 50px;
}
}
.middle {
margin: 0 20px;
@media (max-width: 640px) {
margin: 0;
}
}
label {
input {
@media (max-width: 640px) {
position: relative;
top: 3px;
}
}
span {
@media (max-width: 640px) {
position: relative;
left: -5px;
}
}
}
}
i {
position: absolute;
right: 0;
color: lightsteelblue;
font-size: 12px;
}
input[type="text"] {
-webkit-appearance: none;
appearance: none;
padding: 5px;
outline: none;
color: #464a4c;
background-color: #fff;
border-radius: 3px;
border: 1px solid rgba(0, 0, 0, .15);
font-size: 14px;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
&:focus {
outline: 0;
border-color: #5cb3fd;
}
}
}
}
}
header.warning {
h1, .desciption {
color: #ffc107;
}
.t3 {
color: red;
}
}
</style>
Loading