[Vuejs]-Processing form in modal window with Vue js, Symfony and Semantic UI

0👍

I made it to work. I have declared modal instance twice, firstly in jQuery and that was the issue – it overwrite my second instance in Vue.
I deleted the modal declaration in jQuery and it is working now.

0👍

Since you are using el: '#app' in Vue, you need a wrapping element with id=”app”

<div id="app">
    <!-- all of your html / template here... -->
</div>

And it looks like your methods attribute is missing a closing brace }:

new Vue({
  ...
  methods: {
    onSubmit: function (e)
    {
      e.preventDefault();
      console.log('hey')
    },
    openModal: function()
    {
      this.modalDom.modal('show');
    }
  } // <-- missing
});

And I’m not sure exactly what form_start() is doing, but as long as you get something like this it should be fine:

<form class="ui form" v-on:submit.prevent="onSubmit">
  <!-- inputs -->
</form>

Leave a comment