feat(ui): unify loading empty error states

This commit is contained in:
Cheng Zhou
2026-03-04 16:40:18 +08:00
parent a3036c2233
commit 5caf4c51cc
5 changed files with 83 additions and 64 deletions
+21
View File
@@ -101,6 +101,27 @@ for (const className of requiredAdminProjectDetailClasses) {
}
}
const stateComponents = [
"src/components/StateLoading.vue",
"src/components/StateEmpty.vue",
"src/components/StateError.vue"
];
const requiredStateClasses = [
"ctms-state",
"ctms-state-title",
"ctms-state-desc"
];
for (const file of stateComponents) {
const content = readFileSync(file, "utf8");
for (const className of requiredStateClasses) {
if (!content.includes(className)) {
missing.push(`${file}:${className}`);
}
}
}
if (missing.length) {
console.error("UI contract check failed. Missing:", missing.join(", "));
process.exit(1);