1 | Mivhak.component('toggle', { |
||
0 ignored issues
–
show
|
|||
2 | template: '<div class="mivhak-toggle"><div class="mivhak-toggle-knob"></div></div>', |
||
3 | props: { |
||
4 | on: true |
||
5 | }, |
||
6 | events: { |
||
7 | click: function() { |
||
8 | this.toggle(); |
||
9 | } |
||
10 | }, |
||
11 | created: function() { |
||
12 | this.$el.addClass('mivhak-toggle-'+(this.on?'on':'off')); |
||
13 | }, |
||
14 | methods: { |
||
15 | toggle: function() { |
||
16 | this.on = !this.on; |
||
17 | this.$el.toggleClass('mivhak-toggle-on').toggleClass('mivhak-toggle-off'); |
||
18 | } |
||
19 | } |
||
20 | }); |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.