mounted()

in packages/vue/vue-application/src/Application.js [87:126]


  mounted() {
    this.$nextTick(() => {
      if (this.removeBodyTag) {
        this.el = this.$refs.el
      } else {
        const [body] = this.$refs.el.children
        this.el = body
      }
    })
    this.addThingToDo('mount', async () => {
      if (!this.id) {
        throw new Error('You should give a id for OS Application');
      }
      // make props for ConsoleOS app
      const appInfo = {
        url: this.jsUrl,
        id: this.id,
        manifest: this.manifest,
        externalsVars: this.sandBox.externalsVars,
        dom: this.el,
        deps: this.deps,
        customProps: {
          ...getParcelProps(this.$props)
        }
      }
      
      // call functions of ConsoleOS app
      const sandBox = this.sandBox;
      this.app = await createMicroApp(appInfo, {
        sandBox,
      })
      //
      await load(this.app);
      this.subLoading = false;
      await mount(this.app, appInfo);
  
      // dispatch appDidMount event
      this.$emit('appDidMount')
    })
  },