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

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

No files matched your search

+21 -26
View File
@@ -1,8 +1,6 @@
<template> <template>
<v-row class="bg-red w-100"> <v-row class="bg-red w-100">
<v-col <v-col class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light">
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
>
<!-- Безопасность --> <!-- Безопасность -->
@@ -10,38 +8,35 @@
</v-row> </v-row>
<v-container class="bg-green"> <v-container class="bg-green">
{{ safetyData }} {{ 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> </v-container>
</template> </template>
<script> <script setup>
import { ref } from 'vue'; import { ref, onBeforeMount } from 'vue';
import {pagecounter} from '@/utils/universal_functions' import { pagecounter } from '@/utils/universal_functions'
import { axiosApiInstance } from '@/utils/axios-api'; import { axiosApiInstance } from '@/utils/axios-api';
export default { pagecounter()
setup() { const safetyData = ref([])
pagecounter()
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> </script>
<style> <style></style>
</style>
+1 -1
View File
@@ -11,4 +11,4 @@ class SafetyFileAPIView(APIView):
all_file = SafetyFile.objects.all() all_file = SafetyFile.objects.all()
serializer_for_file = SafetyFileSerializer(instance=all_file, many=True) serializer_for_file = SafetyFileSerializer(instance=all_file, many=True)
return Response({'safety_files': serializer_for_file.data}) return Response(serializer_for_file.data)