PHP Classes

File: resources/js/Components/ValidationErrors.vue

Recommend this page to a friend!
  Classes of Robert Devenyi   Iceburg CRM   resources/js/Components/ValidationErrors.vue   Download  
File: resources/js/Components/ValidationErrors.vue
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Iceburg CRM
CRM application to manage contacts
Author: By
Last change:
Date: 1 year ago
Size: 546 bytes
 

Contents

Class file image Download
<script setup> import { computed } from 'vue'; import { usePage } from '@inertiajs/inertia-vue3'; const errors = computed(() => usePage().props.value.errors); const hasErrors = computed(() => Object.keys(errors.value).length > 0); </script> <template> <div v-if="hasErrors"> <div class="font-medium text-red-600">Whoops! Something went wrong.</div> <ul class="mt-3 list-disc list-inside text-sm text-red-600"> <li v-for="(error, key) in errors" :key="key">{{ error }}</li> </ul> </div> </template>