How to manipulate two data values in vue

In Vue.JS I have

data() {
      return {
         name: 'John',
         sentence: "Hi my name is {{ name }}",
      };
   },

In my HTML I have

<h2>{{ sentence}}</h2>

But the output is
Hi my name is {{name}}

The {{name}} isn’t being replaced. I am taking this approach because the user can fetch different sentences from a db, so the name has to e dynamically changeable.

34 thoughts on “How to manipulate two data values in vue”

Leave a Comment