Skip to content

Commit 67934c8

Browse files
committed
fix: id of content to be unique
`content` is already used as an id in the server template: https://github.com/nextcloud/server/blob/c10317f7f9f53a4de464915f754896eed7f1ee6c/core/templates/layout.user.php#L125 Make sure to have a unique id and to replace the correct dom element when mounting the vue app. The app uses NcAppContent which is rendered as a `<main>` tag. Mount the app on `main#content` from the server template so there is only one `<main>` on the page. Signed-off-by: Max <max@nextcloud.com>
1 parent f0f8dd5 commit 67934c8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div id="content" class="app-notestutorial">
2+
<div id="vue-content" class="app-notestutorial">
33
<NcAppNavigation>
44
<NcAppNavigationNew v-if="!loading"
55
:text="t('notestutorial', 'New note')"

templates/main.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
<div id="content"></div>
1+
<!--
2+
This is an empty template on purpose.
3+
Nextcloud server renders it inside the default layout
4+
in the <main id="content"> tag.
5+
6+
The vue app created in src/main.js replaces the main tag.
7+
Therefore any content provided here will be overwritten.
8+
-->

0 commit comments

Comments
 (0)