docs(): usage and examples

This commit is contained in:
mhartington
2018-06-18 12:45:06 -04:00
parent 518594bcc4
commit 96945b1ee1
66 changed files with 809 additions and 604 deletions

View File

@ -1,5 +1,6 @@
# ion-scroll
Scroll is a low-level component for arbitrary scrolling areas. It's used internally by Content.
<!-- Auto Generated Below -->
@ -20,11 +21,15 @@ Note, the does not disable the system bounce on iOS. That is an OS level setting
string
The mode for component.
#### scrollEvents
boolean
If true, the component will emit scroll events
## Attributes
@ -41,11 +46,15 @@ Note, the does not disable the system bounce on iOS. That is an OS level setting
string
The mode for component.
#### scroll-events
boolean
If true, the component will emit scroll events
## Events
@ -69,15 +78,23 @@ Emitted when the scroll has started.
#### scrollByPoint()
Scroll by a specified X/Y distance in the component
#### scrollToBottom()
Scroll to the bottom of the component
#### scrollToPoint()
Scroll to a specified X/Y location in the component
#### scrollToTop()
Scroll to the top of the component
----------------------------------------------

View File

@ -25,6 +25,7 @@ export class Scroll {
@Prop({ context: 'queue' }) queue!: QueueController;
@Prop({ context: 'window' }) win!: Window;
/** The mode for component. */
@Prop() mode!: Mode;
@ -35,6 +36,7 @@ export class Scroll {
*/
@Prop({ mutable: true }) forceOverscroll?: boolean;
/** If true, the component will emit scroll events */
@Prop() scrollEvents = false;
/**
@ -109,11 +111,13 @@ export class Scroll {
}
}
/** Scroll to the top of the component */
@Method()
scrollToTop(duration: number): Promise<void> {
return this.scrollToPoint(0, 0, duration);
}
/** Scroll to the bottom of the component */
@Method()
scrollToBottom(duration: number): Promise<void> {
const y = (this.el)
@ -123,11 +127,13 @@ export class Scroll {
return this.scrollToPoint(0, y, duration);
}
/** Scroll by a specified X/Y distance in the component */
@Method()
scrollByPoint(x: number, y: number, duration: number, done?: Function): Promise<any> {
return this.scrollToPoint(x + this.el.scrollLeft, y + this.el.scrollTop, duration, done);
}
/** Scroll to a specified X/Y location in the component */
@Method()
scrollToPoint(x: number, y: number, duration: number, done?: Function): Promise<any> {
// scroll animation loop w/ easing