回答編集履歴

1

atChangeを読みやすくする

2019/02/11 04:39

投稿

Bremenkanp
Bremenkanp

スコア205

test CHANGED
@@ -118,15 +118,15 @@
118
118
 
119
119
  atChange(itemId) {
120
120
 
121
- if (this.value.includes(itemId)) {
121
+ this.$emit('input',
122
122
 
123
- this.$emit('input', this.value.filter(v => v !== itemId))
123
+ this.value.includes(itemId)
124
124
 
125
- } else {
125
+ ? this.value.filter(v => v !== itemId))
126
126
 
127
- this.$emit('input', [...this.value, itemId])
127
+ : [...this.value, itemId]
128
128
 
129
- }
129
+ )
130
130
 
131
131
  }
132
132