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 +}