You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/events.md
+29-6
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ title: 'Events'
4
4
5
5
# Events
6
6
7
-
If you have the need for custom events, please open an issue on the [GitHub repository](https://github.com/TotomInc/vue3-select-component) with your use case and we will be happy to investigate it.
8
-
9
7
## `@option-selected`
10
8
11
9
Emitted when an option is selected, in the same tick where the `v-model` is updated.
12
10
11
+
**Payload**: `Option` - The selected option.
12
+
13
13
```vue
14
14
<template>
15
15
<VueSelect
@@ -23,19 +23,23 @@ Emitted when an option is selected, in the same tick where the `v-model` is upda
23
23
**Note**: this is emitted on the same tick as the v-model is updated, before a DOM re-render.
24
24
25
25
::: info
26
-
If you want to keep track of the selected option, it is recommended to use a `computed` combined with the `v-model`, instead of this event ([see this issue comment](https://github.com/TotomInc/vue3-select-component/issues/7#issuecomment-2083422621)).
26
+
For keeping track of the selected option, it's recommended to use a `computed`property combined with the `v-model` instead of relying on the `@option-selected`event. This approach is more efficient and aligns better with Vue's reactivity system. Here's an example:
0 commit comments