Created
January 28, 2021 08:42
-
-
Save salmanyaqoob/feb0945118cee8372d2eb34faf1e79e9 to your computer and use it in GitHub Desktop.
Animator Screen JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import utils from '../../common/utils.js'; | |
| export default { | |
| data: { | |
| images: [ | |
| { src: '/common/pic1.png' }, | |
| { src: '/common/pic2.png' }, | |
| { src: '/common/pic3.png' }, | |
| { src: '/common/pic4.png' }, | |
| { src: '/common/pic5.png' }, | |
| { src: '/common/pic6.png' }, | |
| ], | |
| handleClick() { | |
| const animator = this.$refs.animator; // Obtain the DOM element whose ref attribute is animator. | |
| const state = animator.getState(); | |
| console.log(state); | |
| if (state === 'paused') { | |
| animator.resume(); | |
| } else if (state === 'stopped') { | |
| animator.start(); | |
| } else { | |
| animator.pause(); | |
| } | |
| }, | |
| backAction() { | |
| utils.backToHome(); | |
| }, | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment