Modal Assync Vuejs

0

I'm trying to make a reusable modal vues passing an object to edit or register but I'm stuck on how to pass the object asynchronously, since the object I want to pass will be changed when the user clicks the edit button for example.

The component has been made the template is below:

<template>
    <div>
        <div id="myModal" class="modal fade" role="dialog">
            <div class="modal-dialog">

                <!-- Modal content-->
                <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">Modal Header</h4>
                </div>
                <div class="modal-body">
                    <p>Some text in the modal.</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
                </div>

            </div>
            </div>
    </div>
</template>

<script>
export default {
  props: {
    propE: {
      type: Object
    }
  },
  mounted() {},
  data() {
    return {};
  },
  methods: {
  }
};
</script>

On the other hand was added the component with the name "modalDinamic" Given the object in the form of:

Prop:{
   jose:'Miguel'
}

The statement was:

<modal-dinamic :propE="Prop"></modal-dinamic>

To be clearer, the parent element will have a method that will say that

this.Prop={
    jose:'joaquin'
}

and this way gives a $ ('# myModal'). show (); I hope I have been clear now.

    
asked by anonymous 24.10.2017 / 14:24

0 answers