♻️ (notes) home is now the note initial screen with a fo…

This commit is contained in:
2021-03-13 22:38:21 +01:00
parent 8fad931dfd
commit 2286bd5d85
8 changed files with 133 additions and 85 deletions

28
src/hooks/useForm.hook.ts Normal file
View File

@@ -0,0 +1,28 @@
import { ref } from '@vue/reactivity'
import { useRouter } from 'vue-router'
export const useForm = () => {
const userInput = ref('')
const repoInput = ref('')
const { push } = useRouter()
const submit = () => {
if (!userInput.value || !repoInput.value) {
return
}
push({
name: 'Home',
params: {
user: userInput.value,
repo: repoInput.value
}
})
}
return {
userInput,
repoInput,
submit
}
}