[Vuejs]-V-model binding to generated input text field

0👍

Try:

created: function () {
    axios.get('/generate_inputURL').then(res => this.OnSuccess(res));    
  }

0👍

Component data must be function not object. You should be seeing warning about this in console. I guess your component is not reactive data then, which means that is not redrawn after on request done.

data(): {
  return {
    generatedform:'',
    generatedcode:''
  }
}

0👍

As I can see, you want to change the vue-app template using v-html attr – I think this is not possible. While mounting the application, the template compiles into render function, so your trick does not make any sense. You can try to do the following:

  1. Construct the template (using html recieved from server as you want ) as string or as hidden el in the DOM

  2. Set it in your app object – template:your_html_template

  3. Create vue app

Leave a comment