这是一个基于 SvelteKit、TypeScript、Tailwind CSS、Vitest 和 Apache ECharts 实现的轻量级问卷演示项目。
项目模拟了一个分章节的问卷流程,支持必填与可选题,并在最终报告页中按章节展示已回答和已跳过的问题。
npm install
npm run dev
浏览器打开 http://localhost:5173 即可访问。
npm run dev
npm run build
npm run preview
npm run test
npm run test:coverage
src/
lib/
components/ 可复用 UI 组件
data/ 问卷结构与模拟数据
i18n/ 语言切换与翻译文件
utils/ 问卷流转、校验与答案格式化工具
routes/
+page.svelte 问卷主页
report/+page.svelte 报告页
tests/
questionnaire.test.ts
screenshot/
页面截图
profile、preferences、planning。q1 到 q12 的线性流程,逻辑简单直接。![]() |
![]() |
![]() |
![]() |
运行全部测试:
npm run test
生成覆盖率报告:
npm run test:coverage
覆盖率报告输出目录:
coverage/index.html
npm run build 可以正常通过,但构建过程中仍会出现一组 SvelteKit / Svelte 版本不匹配的警告。