From 5ae6c6bcbfe63fa945c25ce19f1d9df36a316e8c Mon Sep 17 00:00:00 2001 From: kjimlau <444819769@qq.com> Date: Sun, 2 Jan 2022 10:49:46 +0800 Subject: [PATCH] fix: note width in expaned mode & clickoutside --- src/content-scripts/renderer/popup/index.vue | 2 +- .../renderer/popup/note-book/note-list.vue | 7 ++++--- .../renderer/popup/note-book/note.vue | 19 ++++++++++++++----- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/content-scripts/renderer/popup/index.vue b/src/content-scripts/renderer/popup/index.vue index 48107d2..195f2c8 100644 --- a/src/content-scripts/renderer/popup/index.vue +++ b/src/content-scripts/renderer/popup/index.vue @@ -34,7 +34,7 @@ export default defineComponent({ appWidth.value = e ? AppWidth.expanded : AppWidth.normal; }); const wrapperStyle = computed(() => { - const maxWidth = window.innerWidth * 0.8; + const maxWidth = window.innerWidth * 0.9; const width = appWidth.value > maxWidth ? maxWidth : appWidth.value; return { width: `${width}px`, diff --git a/src/content-scripts/renderer/popup/note-book/note-list.vue b/src/content-scripts/renderer/popup/note-book/note-list.vue index cda203d..e301b81 100644 --- a/src/content-scripts/renderer/popup/note-book/note-list.vue +++ b/src/content-scripts/renderer/popup/note-book/note-list.vue @@ -200,13 +200,14 @@ export default defineComponent({ }; /// doms - const domNoteList = (notes: TNote[]) => { + const domNoteList = (notes: TNote[], expanded?: boolean) => { return notes.map((note, i) => ( { noteDivs.value[i] = el; }} note={note as TNote} + expanded={expanded} curNoteId={curNoteId.value} onDelete={() => handleDeleteNote(note as TNote)} onUpdateNoteNote={handleUpdateNoteNote} @@ -220,7 +221,7 @@ export default defineComponent({ const domTag = (title: string = "", notes: TNote[] = []) => (
{title}
-
{domNoteList(notes)}
+
{domNoteList(notes, true)}
); if (tags.length) { @@ -241,7 +242,7 @@ export default defineComponent({ return domTags; } else { return ( -
{domNoteList(searchedNotes.value)}
+
{domNoteList(searchedNotes.value, true)}
); } }; diff --git a/src/content-scripts/renderer/popup/note-book/note.vue b/src/content-scripts/renderer/popup/note-book/note.vue index 49407f5..187381a 100644 --- a/src/content-scripts/renderer/popup/note-book/note.vue +++ b/src/content-scripts/renderer/popup/note-book/note.vue @@ -2,8 +2,9 @@