Проверен вывод информации на клиент

This commit is contained in:
Alex committed 2024-01-15 09:13:10 +03:00
1 parent bae4547681
commit ff92bca09c
3 files changed
+24 -29

No files matched your search

+23 -28
View File
@@ -1,47 +1,42 @@
<template>
<v-row class="bg-red w-100">
<v-col
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
>
<v-col class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light">
<!-- Безопасность -->
</v-col>
</v-row>
<v-container class="bg-green">
{{ safetyData }}
<!-- <ul>
<li v-for="item in safetyData">{{ item.id }}</li>
</ul> -->
<v-card v-for="safety in safetyData" :title="safety.name_chapter" max-width="470">
<v-list :key="safety.id">
<v-list-item :title="safety.document_category"></v-list-item>
</v-list>
</v-card>
</v-container>
</template>
<script>
import { ref } from 'vue';
import {pagecounter} from '@/utils/universal_functions'
<script setup>
import { ref, onBeforeMount } from 'vue';
import { pagecounter } from '@/utils/universal_functions'
import { axiosApiInstance } from '@/utils/axios-api';
export default {
pagecounter()
setup() {
pagecounter()
const safetyData = ref([])
const safetyData = ref([])
onBeforeMount(() => {
axiosApiInstance.get(`api/safety/files/`).then(result => {
safetyData.value = result.data
})
})
const safety = () => {
axiosApiInstance.get(`api/safety/files/`).then(result => {
safetyData.value = result.data
})
}
// console.log('Должно прийти с сервера хоть что-то' ,safetyData)
return {
safetyData,
safety
}
}
}
</script>
<style>
</style>
<style></style>
+1 -1
View File
@@ -11,4 +11,4 @@ class SafetyFileAPIView(APIView):
all_file = SafetyFile.objects.all()
serializer_for_file = SafetyFileSerializer(instance=all_file, many=True)
return Response({'safety_files': serializer_for_file.data})
return Response(serializer_for_file.data)