refactor: 为测试暴露组件内部状态

This commit is contained in:
2026-08-03 22:21:25 +08:00
parent 9bba684fb2
commit f71abdd000
4 changed files with 30 additions and 0 deletions
+2
View File
@@ -50,6 +50,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
}
});
};
defineExpose({ registerData, loading, submitForm, isNotEmpty });
</script>
<template>
+2
View File
@@ -50,6 +50,8 @@ const handleLogout = async () => {
await router.push("/login");
}
};
defineExpose({ isLoginRoute, showBackButton, pageTitle, handleLogout });
</script>
<style scoped>
+11
View File
@@ -594,6 +594,17 @@ onUnmounted(() => {
}
clear();
});
defineExpose({
taskInfo,
timerRunning,
timerIsOver,
startTimer,
stopTimer,
endTimer,
syncDisplay,
clear,
});
</script>
<template>
+15
View File
@@ -288,6 +288,21 @@ async function previewMaterial() {
results.forEach(({ u, t }) => { titles[u] = t; });
materialPreview.value = renderMarkdown(raw, titles);
}
defineExpose({
priorityOptions,
priority,
taskNum,
taskName,
taskDescription,
materialUrl,
isUpdateMode,
loadTask,
createTask,
updateTask,
submitTask,
convertMaterialUrls,
});
</script>
<template>