From 350d661f025deff0afc46410fc2fd098470d23ca Mon Sep 17 00:00:00 2001 From: Mootfrost777 Date: Tue, 3 Jan 2023 14:27:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D1=81=D1=80=D0=B0=D0=BB=20?= =?UTF-8?q?=D0=B4=D0=B5=D0=B4=D0=BB=D0=B0=D0=B9=D0=BD=D1=8B,=20=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=B2=D1=80=D0=BE=D0=B4=D0=B5=20=D1=81=20=D1=84=D1=80?= =?UTF-8?q?=D0=BE=D0=BD=D1=82=D0=B5=D0=BD=D0=B4=D0=BE=D0=BC=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D0=BE=D0=B1=D1=80=D0=B0=D0=BB=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 0 .idea/ProgTime-Web2-HW1.iml | 9 ++++ .idea/discord.xml | 7 +++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 +++ .idea/workspace.xml | 54 +++++++++++++++++++ .gitignore => frontend/.gitignore | 0 {.vscode => frontend/.vscode}/extensions.json | 0 README.md => frontend/README.md | 0 index.html => frontend/index.html | 0 package.json => frontend/package.json | 0 {public => frontend/public}/vite.svg | 0 {src => frontend/src}/App.vue | 26 ++++++--- {src => frontend/src}/components/Edit.vue | 23 ++++++-- {src => frontend/src}/components/Item.vue | 15 +++--- {src => frontend/src}/main.ts | 0 {src => frontend/src}/style.css | 0 {src => frontend/src}/vite-env.d.ts | 0 tsconfig.json => frontend/tsconfig.json | 0 .../tsconfig.node.json | 0 vite.config.ts => frontend/vite.config.ts | 0 yarn.lock => frontend/yarn.lock | 0 src/models/Note.ts | 11 ---- 23 files changed, 130 insertions(+), 29 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/ProgTime-Web2-HW1.iml create mode 100644 .idea/discord.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml rename .gitignore => frontend/.gitignore (100%) rename {.vscode => frontend/.vscode}/extensions.json (100%) rename README.md => frontend/README.md (100%) rename index.html => frontend/index.html (100%) rename package.json => frontend/package.json (100%) rename {public => frontend/public}/vite.svg (100%) rename {src => frontend/src}/App.vue (56%) rename {src => frontend/src}/components/Edit.vue (51%) rename {src => frontend/src}/components/Item.vue (61%) rename {src => frontend/src}/main.ts (100%) rename {src => frontend/src}/style.css (100%) rename {src => frontend/src}/vite-env.d.ts (100%) rename tsconfig.json => frontend/tsconfig.json (100%) rename tsconfig.node.json => frontend/tsconfig.node.json (100%) rename vite.config.ts => frontend/vite.config.ts (100%) rename yarn.lock => frontend/yarn.lock (100%) delete mode 100644 src/models/Note.ts diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.idea/ProgTime-Web2-HW1.iml b/.idea/ProgTime-Web2-HW1.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/ProgTime-Web2-HW1.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..30bab2a --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5d6acce --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..b5738a3 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1672741867096 + + + + \ No newline at end of file diff --git a/.gitignore b/frontend/.gitignore similarity index 100% rename from .gitignore rename to frontend/.gitignore diff --git a/.vscode/extensions.json b/frontend/.vscode/extensions.json similarity index 100% rename from .vscode/extensions.json rename to frontend/.vscode/extensions.json diff --git a/README.md b/frontend/README.md similarity index 100% rename from README.md rename to frontend/README.md diff --git a/index.html b/frontend/index.html similarity index 100% rename from index.html rename to frontend/index.html diff --git a/package.json b/frontend/package.json similarity index 100% rename from package.json rename to frontend/package.json diff --git a/public/vite.svg b/frontend/public/vite.svg similarity index 100% rename from public/vite.svg rename to frontend/public/vite.svg diff --git a/src/App.vue b/frontend/src/App.vue similarity index 56% rename from src/App.vue rename to frontend/src/App.vue index 773ff76..27aada7 100644 --- a/src/App.vue +++ b/frontend/src/App.vue @@ -2,12 +2,13 @@ import { ref } from 'vue' import Item from "./components/Item.vue"; import Edit from "./components/Edit.vue"; -import { Note } from "./models/Note"; -const notes = ref([new Note(undefined, 'Make SUS'), new Note(undefined, 'аырофщшгвыпгыфа')]) -const currentNote = ref(new Note()) +let id = 0 -function processNote(note: Note) { +const notes = ref([{id: id, title: "Hello World", checked: false}]) +const currentNote = ref({id: id += 1, title: "", checked: false}) + +function processNote(note: any) { const index = notes.value.findIndex((item) => item.id === note.id) if (index !== -1) { notes.value[index] = note @@ -15,26 +16,37 @@ function processNote(note: Note) { else { notes.value.push(note) } + currentNote.value = {id: id += 1, title: "", checked: false} } -function deleteNote(note: Note) { +function deleteNote(note: any) { notes.value = notes.value.filter((item) => item.id !== note.id) } -function editNote(note: Note) { +function editNote(note: any) { currentNote.value = note } + +function updateTitle(title: string) { + currentNote.value.title = title +}