Skip to content

Commit ddb0c03

Browse files
committed
feat: enhance JsonNode component with child path selection and improved styling
1 parent ccae3e5 commit ddb0c03

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/components/JsonNode.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ const toggleSelect = () => {
150150
151151
if (!isSelected.value) {
152152
newPaths.push(props.path)
153+
154+
// If this is an object/array, add all child paths
155+
if (isObject.value) {
156+
newPaths.push(...getAllChildPaths(props.value, props.path))
157+
}
153158
}
154159
155160
emit('select', newPaths)
@@ -214,6 +219,23 @@ defineExpose({
214219
> .node-content {
215220
background-color: rgba(#70a1ff, 0.2);
216221
}
222+
223+
> .children {
224+
background-color: rgba(#70a1ff, 0.1);
225+
border-radius: 4px;
226+
margin: 2px 0;
227+
padding: 2px 0;
228+
229+
.json-node {
230+
.node-content {
231+
background-color: transparent;
232+
233+
&:hover {
234+
background-color: rgba(#70a1ff, 0.15);
235+
}
236+
}
237+
}
238+
}
217239
}
218240
}
219241

0 commit comments

Comments
 (0)