While the code below is functioning as intended, I am encountering an error in the VS Code Typescript compiler stating that "Type 'String' cannot be used as an index type". Oddly enough, using a string literal instead of a variable like sentence['a-string'] allows the Typescript to run without issue.
I am content with how the code is currently set up, but I would like to know if there is a way to resolve this error. Alternatively, is there another method I can use to access sentence[display]?
const props = defineProps<{
sentence: Sentence,
display: String,
}>()
<div v-html="sentence[display]" />
The code is functional, however, the Typescript error persists.