-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayerForm.vue.js
43 lines (43 loc) · 1 KB
/
PlayerForm.vue.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Vue.component('form-player', {
props: ['player'],
template: document.querySelector('#form-player-component').innerHTML,
data() {
return {
levelInput: [
{icon: 'add', handler: this.levelIncrement},
{icon: 'remove', handler: this.levelDecrement},
],
stuffInput: [
{icon: 'add', handler: this.stuffIncrement},
{icon: 'remove', handler: this.stuffDecrement},
],
modifierInput: [
{icon: 'add', handler: this.modifierIncrement},
{icon: 'remove', handler: this.modifierDecrement},
],
}
},
methods: {
levelIncrement() {
this.player.level += 1
},
levelDecrement() {
this.player.level -= 1
},
stuffIncrement() {
this.player.stuff += 1
},
stuffDecrement() {
this.player.stuff -= 1
},
modifierIncrement() {
this.player.modifier += 1
},
modifierDecrement() {
this.player.modifier -= 1
},
remove() {
app.removePlayer(this.player)
}
}
});