File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 */
55
66import { emit , subscribe } from '@nextcloud/event-bus'
7- import Vue from 'vue'
7+ import Vue , { defineAsyncComponent } from 'vue'
88import {
99 ATTACHMENT_RESOLVER ,
1010 EDITOR_UPLOAD ,
@@ -270,10 +270,10 @@ window.OCA.Text.createEditor = async function ({
270270 onSearch = undefined ,
271271 onAttachmentsUpdated = ( { attachmentSrcs } ) => { } ,
272272} ) {
273- const { default : MarkdownContentEditor } = await import (
274- './components/Editor/MarkdownContentEditor.vue'
273+ const MarkdownContentEditor = defineAsyncComponent (
274+ ( ) => import ( './components/Editor/MarkdownContentEditor.vue' ) ,
275275 )
276- const { default : Editor } = await import ( './components/Editor.js' )
276+ const Editor = defineAsyncComponent ( ( ) => import ( './components/Editor.js' ) )
277277
278278 const data = Vue . observable ( {
279279 readonlyBarProps : readonlyBar . props ,
@@ -377,8 +377,8 @@ window.OCA.Text.createTable = async function ({
377377 onLoaded = ( ) => { } ,
378378 onUpdate = ( { markdown } ) => { } ,
379379} ) {
380- const { default : PlainTableContentEditor } = await import (
381- './components/Editor/PlainTableContentEditor.vue'
380+ const PlainTableContentEditor = defineAsyncComponent (
381+ ( ) => import ( './components/Editor/PlainTableContentEditor.vue' ) ,
382382 )
383383
384384 const data = Vue . observable ( {
Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ const workspaceAvailable = loadState('text', 'workspace_available')
1515
1616document . addEventListener ( 'DOMContentLoaded' , async ( ) => {
1717 if ( workspaceAvailable && window . OCA && window . OCA . Files ?. Settings ) {
18- const { default : Vue } = await import ( 'vue' )
19- const { default : FilesSettings } = await import ( './views/FilesSettings.vue' )
18+ const { default : Vue , defineAsyncComponent } = await import ( 'vue' )
19+ const FilesSettings = defineAsyncComponent (
20+ ( ) => import ( './views/FilesSettings.vue' ) ,
21+ )
2022
2123 const vm = new Vue ( {
2224 render : ( h ) => h ( FilesSettings , { } ) ,
You can’t perform that action at this time.
0 commit comments