Commit 4cc4adc
authored
fix: Use Vue 3 function refs for child field components (#13)
- Replace dynamic string refs with function refs for Vue 3 compatibility
- Add fieldRefs data property to store child component references
- Add setFieldRef() method to collect refs from function ref callbacks
- Update fill() method to use fieldRefs object for accessing child components
- Add cleanup for fieldRefs in beforeUnmount lifecycle hook
The previous fix using :ref="'field-' + attribute" didn't work reliably
in Vue 3's v-for loops. Function refs provide direct access to components.1 parent 91a4b6e commit 4cc4adc
3 files changed
Lines changed: 42 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
5 | 23 | | |
6 | 24 | | |
7 | 25 | | |
| |||
0 commit comments