-
Notifications
You must be signed in to change notification settings - Fork 777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing an object as property not working in a vue.js app #2810
Comments
Hi! According to https://custom-elements-everywhere.com/ in order to pass data such as Arrays and Objects, the syntax for Vue shoud be as follows: <template>
<my-component :navi.prop="myNavi" ref="myComponent"></my-component>
<template>
<script lang="ts">
...
export default class MyPage extends Vue {
private myNavi: Navigation = { title: 'My navi' }
}
</script> |
Using the
I have found that if you use the new output target for stencil, |
Hey all 👋 Sorry there was never an initial reply from the team here! This doesn't sound like a direct issue with Stencil, but rather a consequence of Vue's behavior. In addition to workarounds listed in the linked issues, the Stencil team does provide an output target that will generate "wrapper components" specifically for use in Vue applications: Vue output target. You can also learn more about this integration in the Stencil docs. Gonna go ahead and close out this issue, but hope you were able to get everything working! |
you are right |
Stencil version:
I'm submitting a:
[X] bug report
[ ] feature request
[ ] support request
Current behavior:
I’m trying to pass an object as property to my webcomponent, but it’s totally ignored. I’m using stenciljs 2.4.0 and vue.js 2.
The navigation (s. below) object is not passed into the component. The component can not be rendered, because this.navi is undefined.
Expected behavior:
The component is rendered, and this.navi contains the object passed by my vue.js app.
Steps to reproduce:
Related code:
I created the following page in vue:
The corresponding component (created with stencil 2.4.0):
The navigation interface: (it’s part of the webcomponent bundle)
The text was updated successfully, but these errors were encountered: