Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

boyjarv's avatar

How can I render HTML without v-html?

Hi,

When I use v-html my paragraph of text that is supposed to be rendered is not showing on certain screen sizes Is there another way I can get my Paragraph to show?

here is my code:

<div ref="bodyContent" class="ins" v-if="$store.state.device === 'phone' && this.$data._slideIndex === this.element.content.slides.length-1">
            <div v-text="$store.state.courseContent.global.continueMobileIns"></div>
          </div>

this is what is currently being output:

<p class="instruction">Now <strong>scroll</strong> down to continue</p>
0 likes
7 replies
martinbean's avatar

@boyjarv The v-html directive is how you set HTML on an element. So if your content is not showing then there’s another issue (i.e. CSS).

1 like
Ben Taylor's avatar

You are conditionally rendering the elements with v-if. Could this be where your issue is? Especially the $store.state.device === 'phone' bit? Since it is only showing up on certain screen sizes.

1 like
boyjarv's avatar

Yes all sorted now thank you

1 like

Please or to participate in this conversation.