{"_id":"@composy/exam-vue","name":"@composy/exam-vue","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@composy/exam-vue","version":"0.0.1","description":"Vue components for @composy/exam-core","keywords":["exam","vue","vue3","component"],"author":{"name":"LDesign Team"},"license":"MIT","type":"module","sideEffects":false,"exports":{".":{"types":"./es/index.d.ts","import":"./es/index.js","require":"./lib/index.cjs","default":"./es/index.js"},"./composables":{"types":"./es/composables/index.d.ts","import":"./es/composables/index.js","require":"./lib/composables/index.cjs","default":"./es/composables/index.js"},"./composables/*":{"types":"./es/composables/*.d.ts","import":"./es/composables/*.js","require":"./lib/composables/*.cjs","default":"./es/composables/*.js"},"./plugins":{"types":"./es/plugins/index.d.ts","import":"./es/plugins/index.js","require":"./lib/plugins/index.cjs","default":"./es/plugins/index.js"},"./plugins/*":{"types":"./es/plugins/*.d.ts","import":"./es/plugins/*.js","require":"./lib/plugins/*.cjs","default":"./es/plugins/*.js"},"./index.css":"./dist/index.css","./index.min.css":"./dist/index.min.css","./style/index.css":"./lib/style/index.css","./style/index.less":"./es/style/index.less","./package.json":"./package.json"},"main":"./lib/index.cjs","module":"./es/index.js","types":"./es/index.d.ts","unpkg":"./dist/index.js","jsdelivr":"./dist/index.js","scripts":{"build":"ldesign-builder build","type-check":"tsc -p tsconfig.typecheck.json --noEmit","lint":"eslint . --cache","lint:check":"eslint . --cache --max-warnings 0","lint:fix":"eslint . --cache --fix","test":"ltesting run:unit","test:run":"ltesting run:unit","test:watch":"ltesting run:unit --watch","test:coverage":"ltesting run:unit --coverage","test:changed":"ltesting run:unit --changed","test:failed":"ltesting run:unit --failed","test:ui":"ltesting dashboard"},"dependencies":{"@composy/exam-core":"^0.0.1","vue-demi":"^0.14.10"},"peerDependencies":{"vue":"^2.7.0 || ^3.5.32"},"devDependencies":{"@antfu/eslint-config":"9.1.0","@composy/builder":"^0.0.1","@composy/testing":"^0.0.1","@vue/test-utils":"^2.4.11","eslint":"10.7.0","fast-check":"^4.9.0","jsdom":"29.1.1","typescript":"5.9.3","vite":"^8.1.4","vue":"3.5.39","vue-tsc":"^3.3.7"},"publishConfig":{"registry":"http://npm.longrise.cn:6286/"},"style":"./dist/style.css","typings":"./es/index.d.ts","browser":"./dist/index.js","_id":"@composy/exam-vue@0.0.1","_nodeVersion":"23.11.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-wxM+bhP1yWvHn8QwU4H4Fg1n9EUj71XTJ9vGnNMq1fzcMS9RtUlWyMFU+nDQExARUlwnbMN+o7T18Nyn5xt2jg==","shasum":"c869fb64717d363e904cbc28b534ab3e157e99ef","tarball":"https://registry.npmjs.org/@composy/exam-vue/-/exam-vue-0.0.1.tgz","fileCount":68,"unpackedSize":181304,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDa9T2AuAA3tIox98AvqR6hPOLuGf/YS7OqhjDo6X72MAiEA35XHRBx520CdSjR7G5x1JUJXUJ01x3SWUCE+UQrc1c0="}]},"_npmUser":{"name":"swimly","email":"979741120@qq.com"},"directories":{},"maintainers":[{"name":"swimly","email":"979741120@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/exam-vue_0.0.1_1786949099553_0.999569118944063"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-17T06:44:59.400Z","0.0.1":"2026-08-17T06:44:59.690Z","modified":"2026-08-17T06:44:59.887Z"},"maintainers":[{"name":"swimly","email":"979741120@qq.com"}],"description":"Vue components for @composy/exam-core","keywords":["exam","vue","vue3","component"],"author":{"name":"LDesign Team"},"license":"MIT","readme":"# @composy/exam-vue\n\n在线考试与测评 Vue 3 组件库 - 基于 `@composy/exam-core` 核心的 Vue 3 适配层\n\n## 安装\n\n```bash\npnpm add @composy/exam-vue\n```\n\n## 快速开始\n\n### 全局安装\n\n```typescript\nimport { ExamPlugin } from '@composy/exam-vue';\n\napp.use(ExamPlugin);\n```\n\n### 按需使用\n\n```vue\n<template>\n  <ExamDesigner\n    :paper=\"paper\"\n    :theme=\"theme\"\n    @change=\"onPaperChange\"\n  />\n  <ExamPlayer\n    :paper=\"paper\"\n    :duration=\"120\"\n    :show-timer=\"true\"\n    @submit=\"onSubmit\"\n  />\n</template>\n\n<script setup lang=\"ts\">\nimport { ExamDesigner, ExamPlayer } from '@composy/exam-vue';\nimport type { ExamPaper } from '@composy/exam-vue';\n\nconst paper = ref<ExamPaper>({ /* ... */ });\nconst theme = ref<'light' | 'dark'>('light');\n\nconst onPaperChange = (p: ExamPaper) => { /* ... */ };\nconst onSubmit = (answers) => { /* ... */ };\n</script>\n```\n\n## 组件\n\n### ExamDesigner\n\n| Prop | 类型 | 默认值 | 说明 |\n|------|------|--------|------|\n| `paper` | `ExamPaper` | - | 试卷数据 |\n| `questionBank` | `Question[]` | - | 题库数据 |\n| `theme` | `'light' \\| 'dark'` | `'light'` | 主题 |\n| `draggable` | `boolean` | `true` | 是否允许拖拽排序 |\n\n| Event | 参数 | 说明 |\n|-------|------|------|\n| `change` | `ExamPaper` | 试卷变更 |\n| `question:add` | `Question` | 添加题目 |\n| `question:remove` | `string` | 移除题目 |\n\n### ExamPlayer\n\n| Prop | 类型 | 默认值 | 说明 |\n|------|------|--------|------|\n| `paper` | `ExamPaper` | - | 试卷数据 |\n| `duration` | `number` | - | 考试时长(分钟) |\n| `theme` | `'light' \\| 'dark'` | `'light'` | 主题 |\n| `showAnswerCard` | `boolean` | `true` | 显示答题卡 |\n| `showTimer` | `boolean` | `true` | 显示计时器 |\n| `antiCheat` | `boolean` | `false` | 启用防作弊 |\n| `autoSave` | `boolean` | `true` | 启用自动保存 |\n\n| Event | 参数 | 说明 |\n|-------|------|------|\n| `answer` | `(questionId, answer)` | 答题 |\n| `submit` | `AnswerRecord[]` | 提交 |\n| `timeup` | - | 时间到 |\n| `cheat:detected` | `string` | 作弊检测 |\n| `autosave` | `AnswerRecord[]` | 自动保存 |\n\n## Composables\n\n### useExamDesigner\n\n```typescript\nconst {\n  instance,\n  paper,\n  create,\n  setPaper,\n  addQuestion,\n  removeQuestion,\n  randomGenerate,\n  addSection,\n  setTheme,\n  destroy,\n} = useExamDesigner();\n```\n\n### useExamPlayer\n\n```typescript\nconst {\n  instance,\n  answers,\n  currentIndex,\n  remainingTime,\n  scoreResult,\n  create,\n  setAnswer,\n  goToQuestion,\n  next,\n  prev,\n  toggleFlag,\n  submit,\n  autoScore,\n  pauseTimer,\n  resumeTimer,\n  setTheme,\n  destroy,\n} = useExamPlayer();\n```\n\n## 子路径导出\n\n| 路径 | 说明 |\n|------|------|\n| `@composy/exam-vue` | 主入口 |\n| `@composy/exam-vue/composables` | 组合式函数 |\n| `@composy/exam-vue/plugins` | Vue 插件 |\n\n## 构建产物\n\n```\ndist/   # UMD 格式\nes/     # ESM 格式\nesm/    # ESM 格式\nlib/    # CJS 格式\n```\n\n## 依赖\n\n- `@composy/exam-core` - 核心引擎\n- `vue` ^2.7.0 || ^3.5.32 (peerDependency)\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-46a09253a4ce8a0da13a112fa1755f3f"}