Is it possible to trigger a function in a Stencil component from the parent Vue instance?
For example, I would like to call the callChild()
method in the Vue instance, which will then trigger the doSomething()
function in the Stencil component.
The main HTML file with Vue code that contains the Stencil component:
<body>
<div id="app">
<test-component :rules="[required, passwordRule]" :placeholder="placeholder" :label="label" :value="value" @valueChange="e => onValueChange"></test-component>
{{value}}
<button @click="foo()">Test</button>
</div>
</body>
...
Stencil component code:
import { h, Component, Element, Event, EventEmitter, State, Watch, Prop, Method } from '@stencil/core';
@Component({
tag: 'test-component',
styleUrl: 'test-component.css',
})
export class FormInputBase {
@Element() el: HTMLElement;
...