Advertisement
VotiveProject

Untitled

Apr 19th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. template: '<div v-bind:id="id" class="list">\
  2. <i @click="left" class="left flaticon-left-arrow"></i>\
  3. <div>{{ values[index] }}</div>\
  4. <i @click="right" class="right flaticon-arrowhead-pointing-to-the-right"></i></div>',
  5. props: ['id','num'],
  6. data: function(){
  7. return {
  8. index: 0,
  9. values: this.num ? [-1,-0.1,-0.2,-0.3,-0.4,-0.5,-0.6,-0.7,-0.8,-0.9,0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1] : data[this.id],
  10. }
  11. },
  12. methods: {
  13. left: function(event){
  14. this.index--
  15. if(this.index < 0) this.index=0
  16. this.send()
  17. },
  18. right: function(event){
  19. this.index++
  20. if(this.index == this.values.length) this.index=0
  21. this.send()
  22. },
  23. send: function(){
  24. var value = this.num ? this.values[this.index] : this.index
  25. //console.log('ChangeCharacterParam:'+this.id+':'+Number(value))
  26. mp.trigger('ChangeCharacterParam', this.id, Number(value))
  27. }
  28. }
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement