import { globalState } from '../../app/global-state'; export const VueJsxTransform = { install(vue) { vue.mixin(vue.extend({ beforeCreate() { const originalCreateElement = this.$createElement; this.$createElement = ( tag: any, data: any, ...children: any[] ) => { if (data != null) { for (const propName in data) { if (propName.indexOf('on') == 0 && propName.length > 2) { const eventName = propName.substring(2).toLowerCase(); if (data.on == null) { data.on = {}; } data.on[eventName] = data[propName]; } } } if (data?.onClick != null) { console.error(data); globalState.kurek = data; } return originalCreateElement( tag, data, children, ); }; }, })); }, };