The vue-json-pretty component accepts several props to control data rendering, selection behavior, and visual styling.
Key Data Props:
data (v-model): The source data object. Note: This must be a JSON object, not a JSON string.selectedValue (v-model): Two-way binding for the selected data path (supports string or array).rootPath: Defines the top-level data path (default: 'root').indent: Indentation level (default: 2).deep: Maximum depth before nodes are collapsed (default: Infinity).collapsedNodeLength: Threshold for objects or arrays to be collapsed (default: Infinity).showLength: If true, displays the length when data is collapsed.
Selection & Interaction Props:
selectableType: Defines selection mode: 'multiple' or 'single' (default: none).nodeSelectable: A function (node) => boolean to define which nodes can be selected.showSelectController: Displays the selection controller.selectOnClickNode: Triggers selection when a node is clicked (default: true).highlightSelectedNode: Highlights the currently selected node (default: true).collapsedOnClickBrackets: Allows collapsing/expanding by clicking brackets (default: true).
Visual & Theme Props:
theme: Set to 'light' or 'dark' (default: 'light').showLine: Displays identification lines (default: true).showLineNumber: Displays line numbers (default: false).showIcon: Displays icons (default: false).showDoubleQuotes: Displays double quotes for keys (default: true).
Virtual Scrolling (for large datasets):
virtual: Enables virtual scrolling (default: false).height: Total height required when using virtual scrolling (default: 400).itemHeight: Height of each node (can be an estimate) (default: 20).dynamicHeight: Enables dynamic height for each row when using virtual scrolling (default: true).
Editing & Custom Rendering:
editable: Enables editing mode (default: false).editableTrigger: The trigger for editing: 'click' or 'dblclick' (default: 'click').renderNodeKey: Custom renderer for node keys.renderNodeValue: Custom renderer for node values.renderNodeActions: Custom renderer for node actions.