code.js 413 B

1234567891011121314151617181920
  1. Vue.component('modal', {
  2. template: `
  3. <div class="modal is-active">
  4. <div class="modal-background"></div>
  5. <div class="modal-content">
  6. <div class="box">
  7. <slot></slot>
  8. </div>
  9. </div>
  10. <button class="modal-close" @click="$emit('close')"></button>
  11. </div>
  12. `,
  13. });
  14. const app = new Vue({
  15. el: '#root',
  16. data: {
  17. showModal: false,
  18. },
  19. });