Script
const amountRef = ref(null);
const amount = ref(0.1);
const insertSuggestion = (e, value) => {
e.preventDefault();
e.stopPropagation();
amount.value = value;
amountRef.value.focus();
};
Template
<Suggestion
class="..."
v-for="suggestion in suggestions"
:key="suggestion"
@click="insertSuggestion($event, suggestion)"
>
{{ suggestion }}
</Suggestion>
<input
class="..."
@keyup.enter="handleBuy"
placeholder="Amount"
ref="amountRef"
v-model="amount"
/>
