Skip to content

Commit 5096946

Browse files
committed
chore: move development template into scripts
1 parent 78bf31a commit 5096946

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,3 @@ There are some other scripts available in the `scripts` section of the `package.
9191
- **`styles`**: contains code for styles of different spinners, they are written with [Less](http://lesscss.org/).
9292

9393
- **`types`**: contains TypeScript type definitions
94-
95-
- **`example`**: contains basic example for development.

example/index.html renamed to scripts/dev_template.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
module.exports = `
12
<!DOCTYPE html>
23
<html lang="en">
34
<head>
45
<meta charset="UTF-8">
56
<meta name="viewport" content="width=device-width, maximum-scale=1, minimum-scale=1, initial-scale=1, user-scalable=no, shrink-to-fit=no">
6-
<title>Vue-infinite-loading Simple</title>
7+
<title>Vue-infinite-loading Testing</title>
78
<script src="../node_modules/vue/dist/vue.js"></script>
89
<script src="../vue-infinite-loading.js"></script>
910
<style>
1011
body{
1112
margin: 0;
1213
}
13-
.example-list-item{
14+
.item{
1415
margin: 0;
1516
padding: 0 10px;
1617
font-size: 14px;
@@ -20,26 +21,25 @@
2021
border-top: 1px solid #fff;
2122
border-bottom: 1px solid #e3e3e3;
2223
}
23-
.example-list-item::before{
24+
.item::before{
2425
content: 'Line: ';
2526
}
2627
</style>
2728
</head>
2829
<body>
2930
<div id="app">
30-
<p class="example-list-item" v-for="item in list" v-text="item"></p>
31-
<infinite-loading @infinite="infiniteHandler" :distance="distance" ref="infiniteLoading"></infinite-loading>
31+
<p class="item" v-for="item in list" :key="item" v-text="item"></p>
32+
<infinite-loading @infinite="infiniteHandler"></infinite-loading>
3233
</div>
3334
<script>
3435
new Vue({
3536
el: '#app',
3637
data: {
37-
distance: 100,
3838
list: []
3939
},
4040
methods: {
4141
infiniteHandler: function ($state) {
42-
if (this.list.length > 200) {
42+
if (this.list.length > 100) {
4343
$state.complete();
4444
} else {
4545
setTimeout(function () {
@@ -58,3 +58,4 @@
5858
</script>
5959
</body>
6060
</html>
61+
`;

scripts/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ if (process.env.NODE_ENV === 'production') {
9494
// development configurations
9595
module.exports.plugins.push(new HtmlWebpackPlugin({
9696
filename: 'index.html',
97-
template: './example/index.html',
97+
template: './scripts/dev_template.js',
9898
inject: false
9999
}));
100100
}

0 commit comments

Comments
 (0)