Новости с текстом

This commit is contained in:
iriska-gri committed 2023-12-14 09:47:00 +03:00
1 parent 31b1a9e1c5
commit f9b5b7853b
1 file changed
+28 -7
+28 -7
View File
@@ -2,7 +2,7 @@
<div class="d-flex flex-column flex-fill"> <div class="d-flex flex-column flex-fill">
<v-row class="d-flex flex-column "> <v-row class="d-flex flex-column ma-0">
<v-col class=" flex-column d-flex "> <v-col class=" flex-column d-flex ">
<v-row class="flex-grow-0"> <v-row class="flex-grow-0">
<v-col class="pb-0 pr-0 "> <v-col class="pb-0 pr-0 ">
@@ -16,6 +16,7 @@
{{newsFull.title}} {{newsFull.title}}
</v-col> </v-col>
<v-col class="pa-0 pr-3 pt-1 flex-grow-1 d-flex flex-column flex-wrap"> <v-col class="pa-0 pr-3 pt-1 flex-grow-1 d-flex flex-column flex-wrap">
<!-- <my-helper :pretext="newsFull.text.length"/> -->
<v-switch <v-switch
v-model="gallery" v-model="gallery"
class="align-self-end comgal" class="align-self-end comgal"
@@ -46,6 +47,7 @@
</v-tooltip> </v-tooltip>
</template> </template>
</v-switch> </v-switch>
</v-col> </v-col>
</v-row> </v-row>
</v-card-title> </v-card-title>
@@ -59,12 +61,12 @@
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
<!-- <v-row> <v-row>
<v-col class="pt-0 pr-0"> <v-col class="pt-0 pr-0">
<v-card <v-card
class="rounded-t-0 flex-column d-flex h-100 Line truncated class="rounded-t-0 flex-column d-flex h-100 Line truncated
> >
<v-list-item class="w-100"> <!-- <v-list-item class="w-100">
<template v-slot:prepend> <template v-slot:prepend>
<v-avatar <v-avatar
color="loading_avatar" color="loading_avatar"
@@ -86,12 +88,11 @@
<span class="subheading">{{ newsFull.comment.length }}</span> <span class="subheading">{{ newsFull.comment.length }}</span>
</div> </div>
</template> </template>
</v-list-item> </v-list-item> -->
<v-divider/> <v-divider/>
<v-row class="ma-0 my-3 overflow-auto h-0"> <v-row class="ma-0 my-3 overflow-auto h-0">
<v-col class="pa-0"> <v-col class="pa-0">
<v-card-text class="pt-0"> <v-card-text class="pt-0">
<div v-if="newsFull.text" v-html=formatText(newsFull.text)> <div v-if="newsFull.text" v-html=formatText(newsFull.text)>
</div> </div>
<div v-else> <div v-else>
@@ -110,7 +111,7 @@
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
</v-col> <!--</v-col>
<v-col class="flex-column d-flex " <v-col class="flex-column d-flex "
> >
@@ -316,6 +317,11 @@ import { useRoute } from 'vue-router'
import { axiosApiInstance } from '@/utils/axios-api' import { axiosApiInstance } from '@/utils/axios-api'
import { ref } from 'vue' import { ref } from 'vue'
import { baseURL } from '@/utils/axios-api' import { baseURL } from '@/utils/axios-api'
import {checkremote} from '@/utils/universal_functions'
import { spravURL } from '@/utils/axios-api'
import {useAccountStore} from '@/store/AccountStore'
const accountStore = useAccountStore()
export default { export default {
@@ -355,13 +361,28 @@ export default {
loadNews() loadNews()
const splitname = (name) => {
return name.familyname + ' ' + name.name[0] + '.' + name.parentname[0]+ '.'
}
const formatText= (text) => {
return text.replaceAll('src="/media/uploads', `src="${baseURL}media/uploads`)
}
return { return {
route, route,
newsFull, newsFull,
gallery, gallery,
burl burl,
checkremote,
spravURL,
splitname,
accountStore,
formatText
} }
} }