<template>
  <pop ref="popRef" :on-close="onClose" :allowClose="allowClose">
    <login-form :callback="afterLogin" :account="account" :formType="formType"></login-form>
  </pop>
</template>
<script setup>
import LoginForm from '@/components/login-form/index.vue';
import pop from '@/components/pop/index.vue';
import { userState } from "@/common/sign-log/user.js";
const { callback, account, formType, onClose } = defineProps({
  callback: Function,
  account: String,
  formType: String,
  onClose: Function,
});
const popRef = useTemplateRef('popRef');
const allowClose = ref(true)
function afterLogin() {
  if(callback) {
    callback()
  }
  popRef.value?.close()
}

onMounted(()=>{
  popRef.value?.open();
  allowClose.value = userState.commonData.triggerRule.allowClose
})
</script>
