[Vuejs]-Is there a better solution than `v-html` in vue

1👍

Use interpolation for rendering.

<script setup>
    import { ref } from "vue";
    const data1 = [
      { part1: "An approachable,", part2: "performant", part3: "and versatile framework for building web user interfaces." },
      { part1: "The library for web and", part2: "native", part3:"user interfaces" },
    ];
</script>

<template>
  <div class="data">
    <p v-for="(item, index) in data1" :key="index">
      {{ item.part1 }} <b>{{ item.part2 }}</b> {{ item.part3 }}
    </p>
  </div>
</template>

Leave a comment