Skip to content
This repository was archived by the owner on Jan 18, 2025. It is now read-only.

Commit 0fd0f1f

Browse files
author
Ernest
committed
fix: invalid props
1 parent ac61f54 commit 0fd0f1f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Diff for: lib/components/Wrapper.vue

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
:id="`object-visualizer-${objectVisualizerUid}--${
1313
path.length === 0 ? 'root' : path.join('-')
1414
}`"
15-
:role="role"
16-
:aria-level="role ? ariaLevel + 1 : void 0"
1715
:class="ariaLevel === 0 ? 'object-visualizer' : void 0"
16+
v-bind="attrs"
1817
/>
1918
</template>
2019

@@ -117,10 +116,19 @@ const Wrapper = defineComponent({
117116
}
118117
}
119118
})
119+
const attrs = computed(() => {
120+
const attrs: { role?: string; ariaLevel?: number } = {}
121+
if (role.value !== void 0) {
122+
attrs.role = role.value
123+
attrs.ariaLevel = props.ariaLevel
124+
}
125+
return attrs
126+
})
120127
121128
return {
122129
is,
123130
role,
131+
attrs,
124132
objectToString,
125133
TYPE_TO_COMPONENT,
126134
}

0 commit comments

Comments
 (0)