@wanjunshijie/vue-seamless-scroll 0.1.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # vue-seamless-scroll
2
2
 
3
- > github: https://github.com/yelingkong/vue-seamless-scroll
3
+ > github: https://github.com/yelingkong/vue-seamless-scroll/tree/vue2
4
4
 
5
5
 
6
6
 
7
- [Document for vue2](https://github.com/yelingkong/vue-seamless-scroll/tree/vue2#readme)
7
+ [Document for vue3](https://github.com/yelingkong/vue-seamless-scroll#readme)
8
8
 
9
9
 
10
10
 
@@ -28,24 +28,20 @@ npm i @wanjunshijie/vue-seamless-scroll@latest-v2 --save-dev
28
28
 
29
29
  ## Use
30
30
 
31
- `main.ts`
31
+ `main.js`
32
32
 
33
- ```ts
34
- import { createApp } from 'vue'
33
+ ```js
34
+ import Vue from 'vue'
35
35
  import App from './App.vue'
36
- import { VueSeamlessScroll } from '@wanjunshijie/vue-seamless-scroll'
37
-
38
- const app = createApp(App)
39
- app.use(VueSeamlessScroll)
40
- app.mount('#app')
41
- ```
42
-
43
36
 
37
+ Vue.config.productionTip = false
44
38
 
45
- `env.d.ts`
39
+ import VueSeamlessScroll from '@wanjunshijie/vue-seamless-scroll'
40
+ Vue.use(VueSeamlessScroll)
46
41
 
47
- ```ts
48
- declare module '@wanjunshijie/vue-seamless-scroll'
42
+ new Vue({
43
+ render: h => h(App),
44
+ }).$mount('#app')
49
45
  ```
50
46
 
51
47
 
@@ -54,40 +50,48 @@ declare module '@wanjunshijie/vue-seamless-scroll'
54
50
 
55
51
  ```vue
56
52
  <template>
57
- <div class="box">
58
- <vue-seamless-scroll class="list" :data="data" direction="top" :steep="0.5" roller :distance="20">
59
- <div class="list-item" v-for="item, index in data" :key="index">{{ item.text }}</div>
60
- </vue-seamless-scroll>
53
+ <div id="app">
54
+ <div class="box">
55
+ <vue-seamless-scroll class="list" :data="data" direction="top" :steep="0.5" roller :distance="20">
56
+ <div class="list-item" v-for="item, index in data" :key="index">{{ item.text }}</div>
57
+ </vue-seamless-scroll>
58
+ </div>
61
59
  </div>
62
60
  </template>
63
61
 
64
- <script setup lang="ts">
65
- import { ref } from 'vue'
66
-
67
- let data = ref([
68
- { text: 'test' },
69
- { text: 'test' },
70
- { text: 'test' },
71
- { text: 'test' },
72
- { text: 'test' },
73
- { text: 'test' },
74
- { text: 'test' },
75
- { text: 'test' },
76
- { text: 'test' },
77
- { text: 'test' },
78
- { text: 'test' },
79
- { text: 'test' },
80
- { text: 'test' },
81
- { text: 'test' },
82
- { text: 'test' },
83
- { text: 'test' },
84
- { text: 'test' },
85
- ])
62
+ <script>
63
+ export default {
64
+ name: 'App',
65
+ data() {
66
+ return {
67
+ data: [
68
+ { text: 'test' },
69
+ { text: 'test' },
70
+ { text: 'test' },
71
+ { text: 'test' },
72
+ { text: 'test' },
73
+ { text: 'test' },
74
+ { text: 'test' },
75
+ { text: 'test' },
76
+ { text: 'test' },
77
+ { text: 'test' },
78
+ { text: 'test' },
79
+ { text: 'test' },
80
+ { text: 'test' },
81
+ { text: 'test' },
82
+ { text: 'test' },
83
+ { text: 'test' },
84
+ { text: 'test' },
85
+ ]
86
+ }
87
+ },
88
+ }
86
89
  </script>
87
90
 
88
91
  <style scoped>
89
92
  .box {
90
93
  width: 100%;
94
+ height: 200px;
91
95
  padding-top: 50px;
92
96
  display: flex;
93
97
  justify-content: center;
@@ -107,6 +111,7 @@ let data = ref([
107
111
  background-color: aliceblue;
108
112
  }
109
113
  </style>
114
+
110
115
  ```
111
116
 
112
117
 
package/dist/demo.html ADDED
@@ -0,0 +1 @@
1
+ <!doctype html><meta charset="utf-8"><title>vue-seamless-scroll demo</title><script src="./vue-seamless-scroll.umd.js"></script><script>console.log(vue-seamless-scroll)</script>