<script setup lang="ts">
import { onMounted, onUpdated, watch } from 'vue';

const props = defineProps<{
  hasError: boolean
}>();

const emit = defineEmits<{
  (e: 'update:error', value: boolean): void
}>();

onMounted(() => {
  emit('update:error', props.hasError);
});

onUpdated(() => {
  emit('update:error', props.hasError);
});

watch(() => props.hasError, (val) => {
  emit('update:error', val);
});
</script>
