-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: bugs caused by branch fix (#68)
Co-authored-by: Merlin Flach <merlin.flach@singular-it.de>
- Loading branch information
1 parent
2a995bc
commit 8bdb74b
Showing
9 changed files
with
45 additions
and
78 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
import type {SetupContext} from 'vue' | ||
import {ref, watch} from 'vue' | ||
import {computed, ref} from 'vue' | ||
|
||
export default function useSearch(context: SetupContext) { | ||
const input = ref<HTMLInputElement | null>(null) | ||
const search = ref('') | ||
const searchString = ref('') | ||
const search = computed<string>({ | ||
get() { | ||
return searchString.value | ||
}, | ||
set(val) { | ||
searchString.value = val | ||
context.emit('search-change', val) | ||
}, | ||
}) | ||
|
||
function clearSearch() { | ||
search.value = '' | ||
if (search.value) | ||
search.value = '' | ||
} | ||
|
||
function handleInput(e: InputEvent) { | ||
search.value = (e.target as HTMLInputElement).value | ||
} | ||
|
||
watch(search, (val) => { | ||
context.emit('search-change', val) | ||
}) | ||
|
||
return { | ||
search, | ||
clearSearch, | ||
handleInput, | ||
input, | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.