From 036853e4cbb8e1bd82fd9dd3ca09e53b6d4ef765 Mon Sep 17 00:00:00 2001 From: iriska-gri <79623434+iriska-gri@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:23:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B9=D0=BA=D0=B8=D0=94=D0=B8?= =?UTF-8?q?=D0=B7=D0=BB=D0=B0=D0=B9=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db.sqlite3 | Bin 294912 -> 294912 bytes front/src/components/news-list.vue | 88 ++++++++++++++++++++++++++++- front/src/views/HomePage.vue | 2 +- 3 files changed, 87 insertions(+), 3 deletions(-) diff --git a/db.sqlite3 b/db.sqlite3 index b141e6c4511750c17e01e7df2cb4d991abf053cb..c28067090115b85c4e0d98293515b74484816ff7 100644 GIT binary patch delta 293 zcmZo@5Nc=;njp>CGEv5vv1Ma|tUjYhbDe&Boj&9CI(?>KeQiqx19K}QBP(NbJp&U< z12aP-10!Qy14~^a44LhJ;+QxbnUy(jPG?`hWpi!cd5Woyg^iV&k&)kHy6t(Uqih!$l-Xri zr*m9ja$#bZ0jfI3#$@F&{liTrJw7phgiEa5rrl)HXM8Zd>pGJ=J7)!hbu1_2bi-Rr zn$rVbF>x_lTDgKXZMV6>bb_5(nL~Oy`vWF>4i0I)2YkzTe*#TD%Rc?%YbJAMBTJ9z Tx$l@v+B;t`ZSQ=+Ts|EDRNq)g delta 247 zcmZo@5Nc=;njp=XJyFJ)F?(ZztUjZAbDe&Boj&9CI(?>KeQgT`12ZcV6DvalJp&U{ z3rhnd10!Qy14~^a44LhJ;+QxbnU%QMrn4_#a@}mGu#0p0&6P|#+l^K+T@qzh;oT(0dqPchZ8Os_w~#5UdbJkwFO3k*u^5iHX=E-<+O74Wb#S-VZU z$)wMCe|pz-CU@ov2Ak=EcbIhe>iH4wuyURL;U<&bcAFbaC)k;lI6|khKVY(F<9ooj bjQ1zd6i$xmx$l@v+B;t`ZSQ=+Ts|EDq`OR& diff --git a/front/src/components/news-list.vue b/front/src/components/news-list.vue index 8542fbc16..497365ad0 100644 --- a/front/src/components/news-list.vue +++ b/front/src/components/news-list.vue @@ -37,11 +37,54 @@
- + {{x.text}} + + + + + + {{ incrementLikes }} + + + + {{ message }} + + + +{{ derementLikes }} + + + + + + + + +
+ +
+ +
+ Тут комменты
@@ -64,6 +107,40 @@ export default { const newss=ref([]) const show=ref(false) + const incrementLikes = ref(0) + const derementLikes = ref(0) + const likedI = ref(false) + const likedD = ref(false) + const message = ref(0) + const commentShow = ref(false) + + const toggleIncrementLike = () => { + if (likedI.value) { + incrementLikes.value-- + } + else { + incrementLikes.value++ + if(likedD.value){ + derementLikes.value-- + likedD.value = false + } + } + likedI.value=!likedI.value + } + + const toggleDecrementLike = () => { + if (likedD.value) { + derementLikes.value-- + } + else { + derementLikes.value++ + if(likedI.value){ + incrementLikes.value-- + likedI.value = false + } + } + likedD.value=!likedD.value + } const burl = baseURL.slice(0,-1) @@ -85,7 +162,14 @@ export default { newss, show, burl, - limitText + limitText, + incrementLikes, + derementLikes, + message, + commentShow, + toggleIncrementLike, + toggleDecrementLike + } } } diff --git a/front/src/views/HomePage.vue b/front/src/views/HomePage.vue index c1cf6b800..7b3d44f4e 100644 --- a/front/src/views/HomePage.vue +++ b/front/src/views/HomePage.vue @@ -68,7 +68,7 @@ {{x.status}} - +