From 697ce57bccfe545492a1e02910d0166af0aae789 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 13 Jan 2026 13:02:25 +0100 Subject: [PATCH 1/3] fix(viewer): mount ViewerComponent Vue from text module The component configured in the viewer handler is instantiated from the vue module inside the viewer. We want to use our own vue module so create an instance with an import of our own vue and mount it. This fixes warnings in development like $attrs is readonly. Also makes the vue2 dev tools work. Signed-off-by: Max --- src/apis/connect.ts | 2 +- src/components/ViewerComponent.vue | 6 ++--- src/viewer.js | 4 +-- src/views/ViewerView.js | 40 ++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 src/views/ViewerView.js diff --git a/src/apis/connect.ts b/src/apis/connect.ts index a9c5c800d83..3d9dc197818 100644 --- a/src/apis/connect.ts +++ b/src/apis/connect.ts @@ -53,7 +53,7 @@ export async function open( /** * Update the guest name * @param guestName the name to use for the local user - * @param connection connection to close + * @param connection connection to update the guest name for */ export async function update( guestName: string, diff --git a/src/components/ViewerComponent.vue b/src/components/ViewerComponent.vue index d7a9837d185..282c0650498 100644 --- a/src/components/ViewerComponent.vue +++ b/src/components/ViewerComponent.vue @@ -40,14 +40,14 @@ import { getClient, getRootPath } from '@nextcloud/files/dav' import { t } from '@nextcloud/l10n' import { getSharingToken } from '@nextcloud/sharing/public' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' -import Vue from 'vue' +import Vue, { defineComponent } from 'vue' import PencilOutlineIcon from 'vue-material-design-icons/PencilOutline.vue' import MarkdownContentEditor from './Editor/MarkdownContentEditor.vue' import PlainTextReader from './PlainTextReader.vue' import getEditorInstance from './Editor.singleton.js' -export default { +export default defineComponent({ name: 'ViewerComponent', components: { NcButton: Vue.extend(NcButton), @@ -184,7 +184,7 @@ export default { }, t, }, -} +})