Last active
November 11, 2021 16:51
-
-
Save SidneyAllen/edb0c42261a1f783872464897e6cc62d 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> | |
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