File tree Expand file tree Collapse file tree 4 files changed +24
-8
lines changed
examples/src/components/pages Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 22 <section class =" animation" >
33 <Example-start
44 title =" Animation Example"
5- description =" This example demonstrates integrating an animation library, nameley GreenSock,
5+ description =" This example demonstrates integrating GreenSock with ScrollView
66 to animate content at different scroll locations."
77 ></Example-start >
88
Original file line number Diff line number Diff line change 1515 <ScrollImage v-for =" i in items" :source =" i.url" :key =" i.id" />
1616 </template >
1717 </scroll-view >
18+ <h3 v-if =" loading" class =" loading" >Loading...</h3 >
1819
1920 </section >
2021</template >
@@ -33,7 +34,8 @@ export default {
3334 data () {
3435 return {
3536 page: 1 ,
36- items: []
37+ items: [],
38+ loading: false ,
3739 }
3840 },
3941 watch: {
@@ -47,13 +49,27 @@ export default {
4749 },
4850 methods: {
4951 fetchMore () {
52+ this .loading = true
5053 axios .get (` https://jsonplaceholder.typicode.com/albums/${ this .page } /photos` )
51- .then (({ data }) => this .items = this .items .concat (data .slice (1 , 6 )))
52- .catch (console .log )
54+ .then (({ data }) => {
55+ this .loading = false
56+ this .items = this .items .concat (data .slice (1 , 6 ))
57+ })
58+ .catch (e => {
59+ this .loading = false
60+ console .log (e)
61+ })
5362 },
5463 },
5564 mounted () {
5665 $scrollview .onLastEntered = () => this .page ++ // last component entered, increment the page
5766 }
5867}
5968 </script >
69+
70+ <style scoped>
71+ .loading {
72+ text-align : center ;
73+ }
74+ </style >
75+
Original file line number Diff line number Diff line change 2828
2929
3030 <p v-if =" currentlyShowing === 'fifth'" class =" scroll-section" >
31- You might also notice they markers dont trigger a change
31+ You might also notice the markers dont trigger a change
3232 of text until they're well into the viewport -- that's because
33- of the scroll-view component 's default offset of 200px (can be changed
33+ of the scroll-view's default offset of 200px (can be changed
3434 via props).
3535 </p >
3636
Original file line number Diff line number Diff line change 1313
1414 <Example-start
1515 title =" Scrollspy Navigation Example"
16- description =" This is an example demonstrating using scroll-view to build an advanced page navigation system.
16+ description =" This is an example demonstrating using ScrollView to build an advanced page navigation system.
1717 As you scroll the page and sections come into view, the menu on the left with dynamically mark your location.
18- You can also easily scroll to sections by clicking items in the navigation."
18+ You can also scroll to sections by clicking items in the navigation."
1919 ></Example-start >
2020
2121 <template v-for =" (section , i ) in pageSections " >
You can’t perform that action at this time.
0 commit comments