Guest User

Untitled

a guest
Apr 22nd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <div id="exercise">
  2. <div><button class="test" v-on:click="newCheck()">New Challenge</button>
  3. <p >Success check is: {{ passCheck }}</p>
  4. </div>
  5. <div>
  6. <button class="roll" v-on:click="roll20()">Roll!</button>
  7. <p>You Rolled a {{ roll20() }}</p>
  8. </div>
  9. </div>
  10.  
  11. new Vue({
  12. el: '#exercise',
  13. data: {
  14. yourRoll: '10',
  15. passCheck: '10',
  16. },
  17. methods: {
  18. roll20: function(){
  19. this.yourRoll = Math.round(Math.random()*19)+1;
  20. return this.yourRoll;
  21. },
  22. newCheck: function(){
  23. this.passCheck = Math.round(Math.random()*19)+1;
  24. }
  25. }
  26. });
Add Comment
Please, Sign In to add comment