Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <template id="userbox_button">
  2. <a v-if="count > 0" class="kiwi-userbox-action" @click="buttonClicked($event)">
  3. <i class="fa fa-warning" aria-hidden="true"></i>
  4. Do NOT Press
  5. </a>
  6. </template>
  7. <script>
  8. kiwi.plugin('test_userbox_button', function(kiwi, log) {
  9.  
  10. var testArgs = {};
  11. var userboxButton = kiwi.Vue.extend({
  12. template: '#userbox_button',
  13. props: ['user', 'userbox'],
  14. data: function data() {
  15. return {
  16. count: 10,
  17. };
  18. },
  19. methods: {
  20. buttonClicked: function buttonClicked(event) {
  21. console.log('pressed', event);
  22. console.log('user:', this.user);
  23. console.log('userbox:', this.userbox);
  24. if (this.count <= 0) {
  25. return;
  26. }
  27. console.log(this.count+'...');
  28. this.count--;
  29. },
  30. },
  31. });
  32.  
  33. var buttonComponent = new userboxButton();
  34. buttonComponent.$mount();
  35. kiwi.addUi('userbox_button', buttonComponent.$el);
  36.  
  37. var b2 = new userboxButton();
  38. b2.$mount();
  39. kiwi.addUi('userbox_button', b2.$el);
  40.  
  41. var b3 = new userboxButton();
  42. b3.$mount();
  43. kiwi.addUi('userbox_button', b3.$el);
  44. });
  45. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement