@antify/ui 2.5.5 → 2.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -193,7 +193,10 @@ function addTag(tagValue: string | number): void {
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
if (Array.isArray(_modelValue.value)) {
|
|
196
|
-
_modelValue.value
|
|
196
|
+
_modelValue.value = [
|
|
197
|
+
..._modelValue.value,
|
|
198
|
+
tagValue,
|
|
199
|
+
];
|
|
197
200
|
} else {
|
|
198
201
|
_modelValue.value = [
|
|
199
202
|
tagValue,
|
|
@@ -205,13 +208,13 @@ function addTag(tagValue: string | number): void {
|
|
|
205
208
|
|
|
206
209
|
function removeLastTag() {
|
|
207
210
|
if (tagInput.value === '' && Array.isArray(_modelValue.value) && _modelValue.value.length > 0) {
|
|
208
|
-
_modelValue.value.
|
|
211
|
+
_modelValue.value = _modelValue.value.filter((element) => element !== _modelValue.value?.pop());
|
|
209
212
|
}
|
|
210
213
|
}
|
|
211
214
|
|
|
212
215
|
function removeTag(tag: string | number) {
|
|
213
216
|
if (_modelValue.value && !props.disabled && !props.skeleton && !props.readonly) {
|
|
214
|
-
_modelValue.value
|
|
217
|
+
_modelValue.value = _modelValue.value.filter((element) => element !== tag);
|
|
215
218
|
}
|
|
216
219
|
}
|
|
217
220
|
|