title: How can I display dynamic HTML having Vue variables inside?
body: <p>I am trying to make the page content dynamic. I am using ck-editor in which i added html content and used the same vue variables inside it which i declared in the vue file where i want to show ck-editor data. I found a similar post <a href="https://stackoverflow.com/questions/48934467/vuejs-editing-html-inside-variable/48935219#48935219">vuejs - “editing” html inside variable
  </a> which works fine if i write the html inside a variable. But in my case, i am saving data in database. It is saving properly with html tags, without converting the tags. When i get data using axios it returns it in form of string. And i used vue variable to display that html.</p>
  
  <p>Here is my code for better understanding:</p>
  
  <pre><code>&lt;div v-html="htmlText"&gt;&lt;/div&gt;
  
  new Vue({
    el: '#app',
    created() {
      this.getSalesContent();
    },
    data: {
      salesContent: '',
      pageName: 'Sales',
      salesNumber: '987-586-4511'
    },
    computed: {
      htmlText() {
        return `${this.salesContent}`;
        //return this.salesContent;
      }
    },
      methods: {
        getSalesContent(){
          axios.get('api/Sales').then(({ data }) =&gt; {  // getting data from DB
            this.salesContent = data.sales; //data.sales have this.pageName and this.salesNumber variables
          });
        }
      }
  });
  </code></pre>
  
  <p>Here is the example of data saved in db:</p>
  
  <pre><code>&lt;p style="font-weight:bold"&gt;&lt;span style="color:red"&gt;{{pageName}}&lt;/span&gt;,&lt;/p&gt;
  
  &lt;p style="font-weight:bold"&gt;&lt;span style="color:red"&gt;${this.pageName} ${this.pageName}&lt;/span&gt;&lt;/p&gt;
  
  &lt;p style="font-weight:bold"&gt;Contact Sales at ${this.salesNumber}  {{salesNumber}}&lt;/span&gt;&lt;/p&gt;
  </code></pre>
  
  <p>I used variables in all possible ways. But on the page they are printing in it the same way i saved it. Here is the output:</p>
  
  <p><a href="https://i.stack.imgur.com/dkNfm.png" rel="nofollow noreferrer">screenshot</a></p>
  
  <p>Can anyone help me make it working.</p>
  
  <p>Thanks in Advance.</p>