<template>
	<view class="flex flex-col w-[40vw]">
		<view class="mb-3 flex flex-row ">
			<cl-input class="" :pt="{ className: '!h-[40px] !rounded-xxl !px-4 !w-[40vw]' }" v-model="form.username"
				placeholder="请输入手机号"></cl-input>
		</view>

		<view class="relative flex flex-row items-center mb-5">
			<cl-input :pt="{ className: '!h-[40px] !rounded-xxl !px-4 !w-[40vw]' }" v-model="form.code" :clearable="false"
				type="number">
			</cl-input>
			<view class="absolute right-0">
				<sms-btn :ref="refs.set('smsBtn')" :phone="form.username"></sms-btn>
			</view>
		</view>


	</view>
</template>

<script setup lang="ts">
import { type PropType } from "vue";
import type { LoginForm } from "./types";
import SmsBtn from "./sms-btn.uvue";
import { useRefs, } from "@/.cool";

const props = defineProps({
	form: {
		type: Object as PropType<LoginForm>,
		default: () => ({})
	}
});

const emit = defineEmits(["success"]);

const refs = useRefs();

</script>
