fix(vue): pass props to component when using modal and popover controller (#22198)

resolves #22189
This commit is contained in:
Liam DeBeasi
2020-09-28 15:05:57 -04:00
committed by GitHub
parent 96596bade3
commit e84f80493c

View File

@ -1,8 +1,16 @@
import { createVNode, render } from 'vue';
export const VueDelegate = () => {
const attachViewToDom = (parentElement: HTMLElement, component: any, _: any, classes?: string[]) => {
const vueInstance = createVNode(component);
const attachViewToDom = (parentElement: HTMLElement, component: any, componentProps: any, classes?: string[]) => {
/**
* Ionic Framework passes in modal and popover element
* refs as props, but if these are not defined
* on the Vue component instance as props, Vue will
* warn the user.
*/
delete componentProps['modal'];
delete componentProps['popover'];
const vueInstance = createVNode(component, componentProps);
const div = document.createElement('div');
classes && div.classList.add(...classes);