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
string | number | object
default:"''"
Two-way binding for the current displayed value.
string
default:"'text'"
The input type, e.g.,
'text' or 'number'.string
default:"''"
Additional CSS classes for the input element.
string
default:"''"
Additional CSS classes for the seek container.
string
default:"''"
Size modifier, e.g.,
'small'.string
default:"''"
Label text displayed alongside the input field.
boolean
default:"false"
Disables the navigation buttons if set to
true.boolean
default:"false"
Allows manual typing of values in the input field if set to
true.Events
event
Triggered when the forward button is clicked.
event
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.