vue3-datagrid icon indicating copy to clipboard operation
vue3-datagrid copied to clipboard

Providing appContext to VGridVueTemplate components

Open c4b4d4 opened this issue 2 years ago • 0 comments

I'm trying to use VGridVueTemplate to display custom components, and it's working great.

But when my component uses CustomDirectives or other libraries that do installs on the app contexts... VGridVueTemplate fails to render correctly cause it has no information from the appContext

I did a little edit on my local files for the repository, to fit my needs:

File: /src/vue-template.tsx Line: 33

const vNode = createVNode(vueConstructor, p);
vNode.appContext = {...globalAppContext};
render(vNode, el);

I did it in an ugly way, but is working for me. And I want to do it correctly, and I think this would be helpful for everyone.

How can it be done correctly? Is there any way to do it already? If not, I think there's need to be a PR for this :-)

One of the libraries I'm using is: https://www.npmjs.com/package/vue3-touch-events

I also want to find a way to provide props to the attached component.

Which I added it by doing this, but again it is ugly. I found a way to add them to the columns data.

File: /src/vue-template.tsx Line: 33 vNode.props = {...vNode.props, ...(vNode.props.column.props||{})};

c4b4d4 avatar May 12 '22 18:05 c4b4d4