<template>
  <u-popup
    :show="show"
    mode="bottom"
    :round="10"
    :closeable="true"
    @close="handleClose"
  >
    <plate-input
      :plate="statePlate.plateNo"
      @export="setPlate"
      @close="handleClose"
    />
  </u-popup>
</template>
<script setup lang="ts">
import plateInput from "@/components/uni-plate-input/uni-plate-input.vue";

const props = defineProps<{
  show: boolean;
}>();
const emit = defineEmits(["handleDialog", "changeCarNo"]);
const statePlate = reactive({
  plateNo: "",
});

const handleClose = () => {
  emit("handleDialog", false);
};
const setPlate = (plate: string) => {
  if (plate.length >= 7) statePlate.plateNo = plate;
  emit("changeCarNo", plate);
  statePlate.plateNo = ''
};
</script>
<style lang="scss" scoped></style>
