Skip to content

Instantly share code, notes, and snippets.

@fahmiegerton
Last active October 3, 2021 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fahmiegerton/7d9a46fb133b16cc5c80aaecc97f909e to your computer and use it in GitHub Desktop.
Save fahmiegerton/7d9a46fb133b16cc5c80aaecc97f909e to your computer and use it in GitHub Desktop.
<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