git.99rst.org
/
flatnotes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
1818923
)
Add exposed focus function to TextInput component
author
Adam Dullage
<redacted>
Sat, 4 May 2024 10:52:30 +0000
(11:52 +0100)
committer
Adam Dullage
<redacted>
Sat, 4 May 2024 10:52:30 +0000
(11:52 +0100)
client/components/TextInput.vue
patch
|
blob
|
history
diff --git
a/client/components/TextInput.vue
b/client/components/TextInput.vue
index 204f631b24a7c83d2eb24ac32d35f5d689309388..4f93c3ed015cb3a9c6716e678149f2175e169ad0 100644
(file)
--- a/
client/components/TextInput.vue
+++ b/
client/components/TextInput.vue
@@
-4,9
+4,19
@@
class="w-full rounded border border-theme-border bg-theme-background-elevated px-3 py-2 focus:outline-none focus:ring-1"
placeholder="Search"
v-model="model"
+ ref="input"
/>
</template>
<script setup>
-const model = defineModel()
+import { ref } from "vue";
+
+const model = defineModel();
+const input = ref();
+
+function focus() {
+ input.value.focus();
+}
+
+defineExpose({ focus });
</script>
git clone https://git.99rst.org/PROJECT