Last active
October 3, 2021 13:37
-
-
Save fahmiegerton/7d9a46fb133b16cc5c80aaecc97f909e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/x-template" id="app-template"> | |
<v-app> | |
<v-container> | |
<v-autocomplete | |
id="city" | |
name="city" | |
required | |
label="Your City" | |
v-model="form.city" | |
hide-no-data | |
hide-selected | |
:items="cities" | |
:loading="loading" | |
:search-input.sync="searchcity" | |
@update:search-input.once="getcity" | |
item-text="city" | |
item-value="iata" | |
placeholder="Start typing to Search" | |
></v-autocomplete> | |
</v-container> | |
</v-app> | |
</script> | |
<div id="app"></div> | |
<script> | |
const App = { | |
template: "#app-template", | |
data: () => ({ | |
form: { | |
city: 'Belfast' | |
}, | |
searchcity: '', | |
cities: [], | |
loading: false | |
}), | |
methods: { | |
getcity() { | |
// the fetch api | |
} | |
} | |
}; | |
new Vue({ | |
vuetify: new Vuetify(), | |
render: (h) => h(App) | |
}).$mount("#app"); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment