1๐
Every time you hit enter, it submits the form. The default behavior for form submission reloads the component, which then by default returns โseoulโ for city.
Try binding an event listener to the formโs submission, and comment out the method call on update(). This will prevent excessive API calls.
<form @submit.prevent="weatherData">
<h3><span> ๋์</span>๋ฅผ ์
๋ ฅํ์ธ์</h3>
<input type="text" v-model="city" />
<button>ํ์ธ</button>
</form>
Conversely, if you want the method to fire on input event, you should validate the input value before sending the API call, as some of the shorter entries throw a 404.
๐คtris
Source:stackexchange.com