<script setup lang="ts">
const emits = defineEmits(['submitClick'])
const buttonLoading = defineModel('buttonLoading', {type: Boolean, required:  true} )
const handleButtonClick = () => {
  // 设置loading状态
  buttonLoading.value = true;
  emits('submitClick', () => {
    // 操作完成后重置loading状态
    buttonLoading.value = false;
  });
};
</script>

<template>
  <el-form-item>
    <el-button
        type="primary"
        class="bf-login-submit-btn"
        @click="handleButtonClick"
        :loading="buttonLoading"
    >
      <slot>
        登陆
      </slot>
    </el-button>
  </el-form-item>
</template>

<style scoped lang="scss">

</style>
