viewer icon indicating copy to clipboard operation
viewer copied to clipboard

Support asynchronous components

Open juliushaertl opened this issue 4 years ago • 2 comments

It would be great if a callback that would return a promise could be provided to the registerHandler function so that the component would only be loaded if it is actually required. Basically something like this:

OCA.Viewer.registerHandler({
	id: 'richdocuments',
	group: null,
	mimes: supportedMimes,
	component: () => import('./Office.vue')
})

https://vuejs.org/v2/guide/components-dynamic-async.html#Async-Components

juliushaertl avatar May 26 '20 15:05 juliushaertl

Well, how can I do that? :p I'm just using the :is vue attribute, I would assume it would work out of the box :see_no_evil:

skjnldsv avatar Jun 16 '20 06:06 skjnldsv

Hm not sure, all i know is that is was not working as expected, but I'll investigate myself a bit when I find some more time.

juliushaertl avatar Jun 16 '20 08:06 juliushaertl