InputSeek.vue component allows users to navigate back and forth through a sequence of values (array or object list) while displaying only the current value. This is useful for scenarios where the next or previous value is not known or for linear navigation through options.
Features
Event-Driven Navigation
Emits
seekForward and seekBack events for navigation logic.Customizable Behavior
Handles both arrays and object lists, with options for inline navigation or external processing.
Optional Typing
Allows users to manually input values if
allowTyping is enabled.Usage
Basic Example: Array Navigation
Example: Object List Navigation
Props
Two-way binding for the current displayed value.
The input type, e.g.,
'text' or 'number'.Additional CSS classes for the input element.
Additional CSS classes for the seek container.
Size modifier, e.g.,
'small'.Label text displayed alongside the input field.
Disables the navigation buttons if set to
true.Allows manual typing of values in the input field if set to
true.Events
Triggered when the forward button is clicked.
Triggered when the back button is clicked.
Example Use Cases
Simple Array Navigation
Object Property Navigation
Notes
- Event Handling: Use
seekForwardandseekBackevents to define custom navigation logic for arrays or object lists. - Custom Seek Logic: Combine with helper functions (
seekForwardArray,seekBackObjectList, etc.) to navigate through different data structures. - Typing Flexibility: Enable
allowTypingto allow direct user input for advanced use cases.