dimanche 30 août 2020

Is there a `v-html` equivalent in Svelte?

I have recently taken on Svelte and I have been coding a couple of things with it. I have been just doing

<script>
  let title = "Amazing title"
</script>

<h1>{ title }</h1>

when setting the complete value of an html element to the variable, but I would like to know if there is a better way to accomplish this such as the v-html in Vue JS

<template>
  <h1 v-html="title" />
</template>

<script>
export default {
  data() {
    return {
      title: "Amazing title"
    }
  }
}
</script>

Thanks a ton for all of your help and have a great day!




Aucun commentaire:

Enregistrer un commentaire