Skip to content

Commit 4a8a3c5

Browse files
committed
Babel config to presets & update version & add compress.
1 parent 57d93e8 commit 4a8a3c5

File tree

11 files changed

+18568
-88
lines changed

11 files changed

+18568
-88
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 TANG
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,14 @@
1919
* [vue-virtual-scroll-list infinite data by increasing 20 each time](https://tangbc.github.io/vue-virtual-scroll-list/demo/infinite/).
2020

2121

22-
## Usage
22+
## Example
2323

24-
Using by npm:
24+
#### Using by npm:
2525

2626
```
2727
npm install vue-virtual-scroll-list --save
2828
```
2929

30-
31-
## Example
32-
33-
Using Vue single file components:
34-
3530
```javascript
3631
<template>
3732
<div>
@@ -61,6 +56,33 @@ Using Vue single file components:
6156

6257
The `<Item />` component is defined outside but included inside the `<VirtualList />` component. `VirtualList` has nothing to do with `<Item />`, so you can use virtual list with any list item component your project need, you just want to care about component `<Item />` and data `items`.
6358

59+
#### Using by script tag:
60+
61+
```html
62+
<script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
63+
<script src="https://tangbc.github.io/vue-virtual-scroll-list/dist/vue-virtual-scroll-list.js"></script>
64+
65+
<div id="app">
66+
<virtual-list :size="40" :remain="8">
67+
<div class="item" v-for="(item, index) of items" :key="index">Item: # {{ index }}</div>
68+
</virtual-list>
69+
</div>
70+
```
71+
72+
```javascript
73+
new Vue({
74+
el: '#app',
75+
data: {
76+
items: new Array(10000)
77+
},
78+
components: {
79+
'virtual-list': VirutalList
80+
}
81+
});
82+
```
83+
84+
**Notice: list Item component or frag using `v-for` must designate the `:key` property.**
85+
6486

6587
## Support props type
6688

demo/build/finite.js

Lines changed: 9230 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/build/finite.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/build/infinite.js

Lines changed: 9230 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/build/infinite.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-virtual-scroll-list.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-virtual-scroll-list.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
22
"name": "vue-virtual-scroll-list",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "A vue component support big data by using virtual scroll list. Tiny, smooth and without any dependence.",
5-
"main": "src/index.js",
5+
"main": "dist/vue-virtual-scroll-list.js",
6+
"files": [
7+
"dist/vue-virtual-scroll-list.js"
8+
],
69
"scripts": {
7-
"demo": "webpack --watch --config webpack.config.js"
10+
"build": "cross-env NODE_ENV=production webpack --config webpack.config.js",
11+
"demo": "cross-env NODE_ENV=development webpack --watch --config webpack.config.js"
812
},
913
"keywords": [
1014
"vue",

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,4 @@ const VirtualList = Vue.component('vue-virtual-scroll-list', {
117117
}
118118
});
119119

120-
export default VirtualList;
120+
module.exports = VirtualList;

0 commit comments

Comments
 (0)