Skip to content

Props availability on mounted hook #72

Open
@paulogr

Description

@paulogr

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions