search

Home  >  Q&A  >  body text

javascript - Repeated calls to vue components

Now I use vue to write projects. There are many pages, many of which have a delete confirmation box. Can I write this delete box as a component and call it every time, but the data inside changes?

Communication between sibling components will be used, but how can the delete button on different pages call this component?

漂亮男人漂亮男人2709 days ago1385

reply all(2)I'll reply

  • 三叔

    三叔2017-06-28 09:31:12

    1. Encapsulate the delete confirmation box into a module.

    2. Save necessary attributes for easy display of information.

    3. Set aside click events to confirm deletion and cancellation.

    The calling method of this module is different from ordinary components. You can go online to find an example of a Vue modal box.

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-28 09:31:12

    You can refer to the implementation of the modal component in iview.

    https://github.com/iview/ivie...

    reply
    0
  • Cancelreply