TerryZ / v-dialogs

A simple style useful dialog component collection for Vue
https://terryz.github.io/docs-vue3/dialog/
MIT License
130 stars 27 forks source link

async component #31

Open RezaErfani67 opened 4 years ago

RezaErfani67 commented 4 years ago

if i write async component, show Vue Warn

  async openReferral(mailID) {
                let that = this;
                let addReferral= async ()=>{return  await import('../../referral/referralTask/add.vue')}
                that.$dlg.modal(addReferral, {width: 800, height: 750, title: "add task"
                    params: {
                    mailID :mailID,
                    }});
            },

image

TerryZ commented 3 years ago

Try below

  async openReferral(mailID) {
    let that = this;
    let addReferral= async ()=>{return  await import('../../referral/referralTask/add.vue')}
    that.$dlg.modal(addReferral(), {width: 800, height: 750, title: "add task"
      params: {
        mailID :mailID,
      }
    });
  },
RezaErfani67 commented 3 years ago

return error

vue.esm.js?a026:628 [Vue warn]: Invalid prop: type check failed for prop "component". Expected Object, Function, got Promise [Vue warn]: Failed to mount component: template or render function not defined VM2541:15 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: http://localhost:8080/commercial/cmcProduct/add.vue

image