Props availability on mounted hook
paulogr opened this issue · 0 comments
paulogr commented
Hello all,
I'm having generating web components using vue-cli but the props passed to my component are never available on mounted hook.
I'm trying to use my webcomponent in a blank html with the follow code:
window.addEventListener('load', function () {
// ...load webcomponent script
script.addEventListener('load', function () {
var ele = d.createElement('my-web-component')
ele.prop1 = { val: 1 }
ele.prop2 = { val: 2 }
document.body.appendChild(ele)
})
})
I tried to set props after append to body, without success too.
Is there a right way to do that?
Thanks!