karol-f / vue-custom-element

Vue Custom Element - Web Components' Custom Elements for Vue.js
https://karol-f.github.io/vue-custom-element/
MIT License
1.97k stars 187 forks source link

Async mounted gets launched twice on root app #224

Closed bppdddqqqq closed 3 years ago

bppdddqqqq commented 4 years ago

Example code

async mounted () {
    const diag = await axios.get(this.urlDiagram)
    const solu = await axios.get(this.urlSolutions)

    console.log('launching twice!')
    console.log(diag, solu)
  }

this elements are props

bppdddqqqq commented 3 years ago

Ok, I found the issue. The issue stems from main.js file double launching the Vue instance. AKA the issue is on my side and not on the library.

Tip for the feature: check if main.js doesnt by accident create multiple instances of the same application

karol-f commented 3 years ago

Great that you've found the issue! Regards