mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-23 00:15:05 +01:00
fix(InputMenu): emit focus event (#2386)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
const open = ref(false)
|
||||
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
|
||||
const selected = ref('Backlog')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UInputMenu
|
||||
v-model="selected"
|
||||
v-model:open="open"
|
||||
:items="items"
|
||||
@focus="open = true"
|
||||
/>
|
||||
</template>
|
||||
@@ -611,6 +611,16 @@ name: 'input-menu-open-example'
|
||||
In this example, press :kbd{value="O"} to toggle the InputMenu.
|
||||
::
|
||||
|
||||
### Control open state on focus
|
||||
|
||||
You can also use the `@focus` directive to control the open state.
|
||||
|
||||
::component-example
|
||||
---
|
||||
name: 'input-menu-open-focus-example'
|
||||
---
|
||||
::
|
||||
|
||||
### Control search term
|
||||
|
||||
Use the `v-model:search-term` directive to control the search term.
|
||||
|
||||
Reference in New Issue
Block a user