Subscribe on changes!

custom element prop error: function prop pass as string

avatar
Apr 23rd 2023

Vue version

3.2,.ce.vue (web components)

Link to minimal reproduction

online demo

Steps to reproduce

In a MyComp.ce.vue SFC:

props: {
  someFn: {
    type: Function as PropType<() => Promise<void>>,
  },
}

then, usage

<my-comp :some-fn="() => {}" />

In MyComp.ce.vue, the prop: someFn print as string.
I found that in dom the some-fn is shown as attribute, I think it should be auto added in dom object property, similar with object or array prop.

What is expected?

the prop: someFn passed should be function.

What is actually happening?

function prop passed as string

System Info

No response

Any additional comments?

No response

avatar
Apr 23rd 2023

my result is ok. i think maybe,it's TypeScript issue.

avatar
Apr 24th 2023

We require Issues to come with a reproduction. We can reopen once one has been provided.

avatar
Apr 24th 2023

@LinusBorg I've update an online demo in details, and I found that it seems a case problem, I'm not sure if this is by design.