ЛайкиДизлайки

This commit is contained in:
iriska-gri committed 2023-09-29 14:23:24 +03:00
1 parent 68c0204fc6
commit 036853e4cb
3 files changed
+87 -3

No files matched your search

BIN
View File
Binary file not shown.
+86 -2
View File
@@ -37,11 +37,54 @@
<v-expand-transition> <v-expand-transition>
<div v-show="x.show"> <div v-show="x.show">
<v-divider></v-divider> <v-divider/>
<v-card-text> <v-card-text>
{{x.text}} {{x.text}}
</v-card-text> </v-card-text>
<v-divider/>
<v-card-actions >
<v-row >
<v-col>
<v-btn
variant="text"
icon="mdi-thumb-up-outline"
color="blue-darken-3"
@click="toggleIncrementLike"
/>
{{ incrementLikes }}
</v-col>
<v-col class="ml-8">
<v-btn
variant="text"
icon="mdi-message-text-outline"
color="teal"
@click="commentShow=!commentShow"
/>
{{ message }}
</v-col>
<v-col class="text-center pr-0">
<v-btn
variant="text"
icon="mdi-thumb-down-outline"
color="red-lighten-2"
@click="toggleDecrementLike"
/>
{{ derementLikes }}
</v-col>
</v-row>
</v-card-actions>
<v-divider class="mb-2"/>
</div>
</v-expand-transition>
<v-expand-transition>
<div v-show="commentShow">
Тут комменты
</div> </div>
</v-expand-transition> </v-expand-transition>
</v-card> </v-card>
@@ -64,6 +107,40 @@ export default {
const newss=ref([]) const newss=ref([])
const show=ref(false) 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) const burl = baseURL.slice(0,-1)
@@ -85,7 +162,14 @@ export default {
newss, newss,
show, show,
burl, burl,
limitText limitText,
incrementLikes,
derementLikes,
message,
commentShow,
toggleIncrementLike,
toggleDecrementLike
} }
} }
} }
+1 -1
View File
@@ -68,7 +68,7 @@
{{x.status}} {{x.status}}
</v-card-title> </v-card-title>
<v-card-text class="numstyle mt-2 py-0 font-weight-bold"> <v-card-text class="numstyle mt-2 py-0 font-weight-bold">
<vue3-autocounter ref='counter' :startAmount='0' :endAmount='Number(x.num)' :duration='1'/> <vue3-autocounter ref='counter' :startAmount='0' :endAmount='Number(x.num)' :duration='2'/>
</v-card-text> </v-card-text>
</v-card> </v-card>