How to show bootstrap modal dialog in vue js?

Asked By: Anonymous

I have been trying to show modal dialog using bootstrap and vue js. I want to show dialog once user successfully registers.

<div>
....
    <div class="modal fade" v-if="isEnabled">
      <div class="modal-dialog" role="dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title">Modal title</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body">
            <p>Modal body text goes here.</p>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-primary">Save changes</button>
            <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
          </div>
        </div>
      </div>
    </div>
....
</div>

But not able to display the dialog. Can anybody help me to do this?


Solution

Answered By: Anonymous

The modal component is managed by jQuery, you have to use jquery to open your modal.

I need you Vue code too help you much, if it’s an ajax request to register user, wait the success callback to make a

$('#modal').modal('show') 

If it’s a synchronous process, call you modal in the mounted method of you Vue instance.

techinplanet staff

techinplanet staff


Windows 10 Kaufen Windows 10 Pro Office 2019 Kaufen Office 365 Lizenz Windows 10 Home Lizenz Office 2019 Home Business Kaufen windows office 365 satın al follower kaufen instagram follower kaufen porno