Skip to content

Commit 6ed8366

Browse files
committed
fixed code format
1 parent a5399e1 commit 6ed8366

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

src/components/MdChips/MdChips.vue

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<md-field class="md-chips" :class="[$mdActiveTheme, chipsClasses]">
3-
<slot/>
3+
<slot />
44

55
<md-chip
66
v-for="(chip, key) in value"
@@ -25,8 +25,7 @@
2525
@input="handleInput"
2626
@keydown.enter="insertChip"
2727
@keydown.8="handleBackRemove"
28-
@focusout="handleFocusOut"
29-
>
28+
@focusout="handleFocusOut">
3029
</md-input>
3130
</md-field>
3231
</template>
@@ -74,25 +73,25 @@
7473
duplicatedChip: null
7574
}),
7675
computed: {
77-
chipsClasses() {
76+
chipsClasses () {
7877
return {
7978
'md-has-value': this.value && this.value.length
8079
}
8180
},
8281
83-
modelRespectLimit() {
82+
modelRespectLimit () {
8483
return !this.mdLimit || this.value.length < this.mdLimit
8584
},
8685
87-
formattedInputValue() {
86+
formattedInputValue () {
8887
if (!this.mdFormat) {
8988
return this.inputValue
9089
}
9190
return this.mdFormat(this.inputValue)
9291
}
9392
},
9493
methods: {
95-
insertChip({target}) {
94+
insertChip ({ target }) {
9695
let inputValue = this.formattedInputValue
9796
9897
if (!inputValue || !this.modelRespectLimit) {
@@ -113,27 +112,27 @@
113112
this.$emit('md-insert', inputValue)
114113
this.inputValue = ''
115114
},
116-
removeChip(chip) {
115+
removeChip (chip) {
117116
const index = this.value.indexOf(chip)
118117
119118
this.value.splice(index, 1)
120119
this.$emit('input', this.value)
121120
this.$emit('md-delete', chip, index)
122121
this.$nextTick(() => this.$refs.input.$el.focus())
123122
},
124-
handleBackRemove() {
123+
handleBackRemove () {
125124
if (!this.inputValue) {
126125
this.removeChip(this.value[this.value.length - 1])
127126
}
128127
},
129-
handleInput() {
128+
handleInput () {
130129
if (this.mdCheckDuplicated) {
131130
this.checkDuplicated()
132131
} else {
133132
this.duplicatedChip = null
134133
}
135134
},
136-
handleFocusOut({target}) {
135+
handleFocusOut({ target }) {
137136
if (this.mdAutoInsert) {
138137
this.insertChip(target)
139138
}
@@ -152,7 +151,7 @@
152151
}
153152
},
154153
watch: {
155-
value() {
154+
value () {
156155
this.checkDuplicated()
157156
}
158157
}
@@ -163,25 +162,25 @@
163162
@import "~components/MdAnimation/variables";
164163
165164
.md-chips.md-field {
166-
padding-top : 12px;
167-
flex-wrap : wrap;
165+
padding-top: 12px;
166+
flex-wrap: wrap;
168167
169168
&.md-has-value {
170169
label {
171-
top : -6px;
172-
}
170+
top: -6px;
173171
}
172+
}
174173
175174
.md-chip {
176-
margin-bottom : 4px;
175+
margin-bottom: 4px;
177176
178177
&:last-of-type {
179-
margin-right : 8px;
180-
}
178+
margin-right: 8px;
181179
}
180+
}
182181
183182
.md-input {
184-
min-width : 128px;
185-
}
183+
min-width: 128px;
186184
}
185+
}
187186
</style>

0 commit comments

Comments
 (0)