Tuesday, January 2, 2018

3. Hello Vue World using v-html

We can include html using v-html.


This is the App.vue file:


<template>
  <h1 v-html="hello" id="app"></h1>
</template>

<script>
export default {
  data () {
    return {
      hello: 'Hello <span><em>Vue</em></span> World'
    }
  }
}
</script>

<style>
span {
  color: red;
  font-size: 24px;
}
</style>

This is the output:


No comments:

Post a Comment