We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14ef03a commit 936d7f0Copy full SHA for 936d7f0
src/components/SearchLocation.vue
@@ -1,10 +1,17 @@
1
<script lang="ts" setup>
2
import { NInput } from 'naive-ui';
3
+import { nextTick, onMounted, ref } from 'vue';
4
import useSocksProxies from '@/composables/useSocksProxies/useSocksProxies';
5
6
const { query } = useSocksProxies();
7
+const inputRef = ref<HTMLInputElement | null>(null);
8
+
9
+onMounted(async () => {
10
+ await nextTick();
11
+ inputRef.value?.focus();
12
+});
13
</script>
14
15
<template>
- <NInput v-model:value="query" placeholder="Search" clearable class="mb-3" />
16
+ <NInput ref="inputRef" v-model:value="query" placeholder="Search" clearable class="mb-3" />
17
</template>
0 commit comments