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

[Support] Vue instance doesn't load correctly #211

Closed izshreyansh closed 4 years ago

izshreyansh commented 4 years ago

Hi, I'm really sorry for opening this issue. This might be duplicate of #169 (But this issue has no resolution) Scripts are loaded fine but i think Vue isn't initialized for some reason.

I have this in my main.js

import Vue from 'vue'
import App from './App.vue'
import 'document-register-element/build/document-register-element'
import vueCustomElement from 'vue-custom-element'

Vue.use(vueCustomElement)

Vue.config.productionTip = false

Vue.customElement('vue-widget', App)

If someone's willing to help, The project is at https://github.com/izshreyansh/vue-custom/.

It's just a vue-cli project without anything else.

karol-f commented 4 years ago

I can see that You are creating custom element (vue-widget) in main.js but not using it in public/index.html so nothing is starting.

Just add <vue-widget></vue-widget> to html file.