function double (i = 0) {
i++;
try {
this.SuggestView = new ymaps.SuggestView(id, {
provider: { suggest: (...args) => this.suggest(...args) },
boundedBy: this.bounds[this.brandCode],
container: document.getElementById(id + '-container'),
results: 50
})
this.SuggestView.events.add('select', e => {
this.geoValue = e.get('item').value
localStorage.setItem('location.city', JSON.parse(e.get('item').jsonData).city)
localStorage.setItem('location.address', e.get('item').value)
this.$emit('handleAddressInput', e.get('item').value)
})
console.log('YAMAPS Init!')
} catch (e) {
console.log(`yamaps init Error: ${e}`)
if(здесь проверяем на наличие элемента, его длина должна быть < 1 || i > 10) {
double (i)
}
}
}
как то так