Currently, I am developing a component that displays tabs along with their corresponding HTML content using v-tab
, v-tab-items
, and v-tab-item
. In the v-tab-item
section, I have included the following snippet:
<v-card flat>
<v-card-text v-html="item.content"></v-card-text>
</v-card>
This code snippet renders the HTML content specified in the items
Object through their content
property. Here is an example of how the data is structured:
data() { return tabNavToolbar: tabNavToolbarImg,
items: [
{
tab: 'About',
content: '<h2 class="mt-8">About</h2><p class="pt-5">Tabs are a form of secondary in-page navigation, helping to group different types of content in a limited space.</p><p class="pt-5">Use tabs to split long content into manageable chunks to avoid overwhelming the user. By default, the first tab is selected.</p><v-card><v-col class="ml-0 mt-3 pt-8 px-10 pb-10 imgBackground d-flex justify-center"><img src="../../../assets/tabnavigation/tabnavigation-toolbar.png" width="100%" height="100%" alt="display of tab navigation toolbar"/></v-col></v-card>'
}
]
}
Unfortunately, the image is not displayed, and even when I directly reference the image URL in a standard img
tag, it still does not render correctly.
I attempted to import the image and bind it to a variable like this:
import tabNavToolbarImg from '../../../assets/tabnavigation/tabnavigation-toolbar.png'
data() { return tabNavToolbar: tabNavToolbarImg,
items: [
{
tab: 'About',
content: '<h2 class="mt-8">About</h2><p class="pt-5">Tabs are a form of secondary in-page navigation, helping to group different types of content in a limited space.</p><p class="pt-5">Use tabs to split long content into manageable chunks to avoid overwhelming the user. By default, the first tab is selected.</p><v-card><v-col class="ml-0 mt-3 pt-8 px-10 pb-10 imgBackground d-flex justify-center"><img :src="tabNavToolbar" width="100%" height="100%" alt="display of tab navigation toolbar"/></v-col></v-card>'
}
]
}
However, these methods do not seem to be effective in displaying the image. Is there a specific reason why images are not rendering using these approaches, and is there a solution to this issue? Thank you for your assistance.