chore: eslint 配置
This commit is contained in:
@ -6,7 +6,7 @@ function checkIsVisible(el: Element, root: Element | null = null) {
|
||||
const elRect = el.getBoundingClientRect();
|
||||
const rootRect = root
|
||||
? root.getBoundingClientRect()
|
||||
: { top: 0, left: 0, bottom: window.innerHeight, right: window.innerWidth };
|
||||
: { bottom: window.innerHeight, left: 0, right: window.innerWidth, top: 0 };
|
||||
|
||||
return (
|
||||
elRect.bottom >= rootRect.top &&
|
||||
@ -32,26 +32,26 @@ function checkIsVisible(el: Element, root: Element | null = null) {
|
||||
*/
|
||||
|
||||
const props = defineProps<{
|
||||
loading: boolean;
|
||||
complete: boolean;
|
||||
error: boolean;
|
||||
errorText: string;
|
||||
loading: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
load: [];
|
||||
clickError: [];
|
||||
load: [];
|
||||
}>();
|
||||
|
||||
defineSlots<{
|
||||
// 加载中
|
||||
loading(): unknown;
|
||||
// 加载完成(还有更多)
|
||||
loaded(): unknown;
|
||||
// 加载完成(没有更多了)
|
||||
complete(): unknown;
|
||||
// 加载失败
|
||||
error(): unknown;
|
||||
// 加载完成(还有更多)
|
||||
loaded(): unknown;
|
||||
// 加载中
|
||||
loading(): unknown;
|
||||
}>();
|
||||
|
||||
const check = (reason?: string) => {
|
||||
|
@ -6,15 +6,15 @@ interface FileExt extends File {
|
||||
}
|
||||
|
||||
interface FileUploadInst extends FileUploadState {
|
||||
chooseDisabled?: boolean;
|
||||
files: FileExt[];
|
||||
uploadedFiles: {
|
||||
rawFile: FileExt;
|
||||
name: string;
|
||||
url: string;
|
||||
status: 'uploading' | 'uploaded' | 'failed';
|
||||
progress: number;
|
||||
rawFile: FileExt;
|
||||
status: 'failed' | 'uploaded' | 'uploading';
|
||||
url: string;
|
||||
}[];
|
||||
chooseDisabled?: boolean;
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -30,11 +30,11 @@ const onUploader = (event: FileUploadUploaderEvent) => {
|
||||
const files = event.files as FileExt[];
|
||||
for (const file of files) {
|
||||
fileUploadRef.value!.uploadedFiles.push({
|
||||
rawFile: file,
|
||||
name: file.name,
|
||||
url: '',
|
||||
status: 'uploading',
|
||||
progress: 0,
|
||||
rawFile: file,
|
||||
status: 'uploading',
|
||||
url: '',
|
||||
});
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
const { remaining: countdownTime, start: startCountdown, isActive: isCounting } = useCountdown($__DEV__ ? 3 : 60);
|
||||
const { isActive: isCounting, remaining: countdownTime, start: startCountdown } = useCountdown($__DEV__ ? 3 : 60);
|
||||
|
||||
const isSending = ref(false);
|
||||
const sendSms = async () => {
|
||||
@ -8,7 +8,7 @@ const sendSms = async () => {
|
||||
try {
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
startCountdown();
|
||||
ToastService.add({ severity: 'info', summary: '提示', life: 3000, detail: '验证码发送成功' });
|
||||
ToastService.add({ detail: '验证码发送成功', life: 3000, severity: 'info', summary: '提示' });
|
||||
} finally {
|
||||
isSending.value = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user