Skip to content

Instantly share code, notes, and snippets.

@SidneyAllen
Last active November 11, 2021 16:51
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 SidneyAllen/edb0c42261a1f783872464897e6cc62d to your computer and use it in GitHub Desktop.
Save SidneyAllen/edb0c42261a1f783872464897e6cc62d to your computer and use it in GitHub Desktop.
<script>
import { ref } from "vue";
// insert import statement
import useAddressSuggestions from "./useAddressSuggestions";
export default {
name: "App",
setup () {
const address = ref()
const city = ref()
const state = ref()
const zip = ref()
// insert 2 const and async function
const suggestions = ref([])
const { getSuggestions } = useAddressSuggestions()
async function onAddressInput (val) {
suggestions.value = await getSuggestions(val)
}
return {
address,
city,
state,
zip,
// insert 3 more return props
suggestions,
getSuggestions,
onAddressInput
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment