{ "slug": "employeecard", "mode": "scenarios", "examples": [ { "id": "employeecard-ex-1", "title": "员工卡片 EmployeeCard 示例 1", "titleSrc": "", "desc": "", "html": "
\n
\n \n \n \n
\n
\n
张
\n
\n 张伟\n 在职\n
\n
工号:E1001
\n
\n
\n 部门:技术中心 · 前端组\n
\n 职位:高级前端工程师\n
\n
\n React\n TypeScript\n 架构\n
\n
", "preview": { "show": [ [ 0, 2, 0 ] ], "hide": [ [ 0, 0 ], [ 0, 1 ], [ 0, 2, 1 ] ], "mode": "scenarios" }, "previewSafe": true, "previewUnsafeReasons": [], "source": "curated", "code": { "html": "
\n
\n \n \n \n
\n
\n
张
\n
\n 张伟\n 在职\n
\n
工号:E1001
\n
\n
\n 部门:技术中心 · 前端组\n
\n 职位:高级前端工程师\n
\n
\n React\n TypeScript\n 架构\n
\n
", "jsx": "import { KoleEmployeeCard } from 'kole-ui/react';\n\nconst employee = {\n name: '张伟',\n empId: 'E1001',\n dept: '技术中心 · 前端组',\n position: '高级前端工程师',\n status: 'active',\n tags: ['React', 'TypeScript', '架构'],\n};\n\n// 悬停卡片右上角出现「发消息 / 详情 / 编辑」,对应 emits message/view/edit\n console.log('发消息', e)}\n onView={(e) => console.log('详情', e)}\n onEdit={(e) => console.log('编辑', e)}\n/>", "vue3": "\n\n", "vue2": "\n\n", "tsx": "import { KoleEmployeeCard } from 'kole-ui/react';\n\ntype EmployStatus = 'active' | 'left';\ninterface Employee {\n name: string;\n empId: string;\n dept: string;\n position: string;\n status: EmployStatus;\n tags: ReadonlyArray;\n phone?: string;\n email?: string;\n}\n\nconst employee: Employee = {\n name: '张伟',\n empId: 'E1001',\n dept: '技术中心 · 前端组',\n position: '高级前端工程师',\n status: 'active',\n tags: ['React', 'TypeScript', '架构'],\n};\n\nfunction log(action: string, e: Employee): void {\n console.log(action, e);\n}\n\n// 悬停卡片右上角出现「发消息 / 详情 / 编辑」,对应 emits message/view/edit\n log('发消息', e)}\n onView={(e: Employee) => log('详情', e)}\n onEdit={(e: Employee) => log('编辑', e)}\n/>", "vue3ts": "\n\n", "vue2ts": "\n\n" }, "notes": [ "依据 frameworks/EmployeeCard.html:38-57 第一张卡片(张伟 / E1001 / 技术中心 · 前端组 / 高级前端工程师 / 在职 / React·TypeScript·架构)", "employee 对象字段与 showContact 见 EmployeeCard.jsx 注释与 EmployeeCard.vue3.vue defineProps;三个操作按钮对应 emits message/view/edit", "TS 形态依据 TS-VARIANTS.md:tsx 用 type EmployStatus 字面量联合 + interface Employee,事件形参标 Employee;vue3ts/vue2ts 用 \n\n", "vue2": "\n\n", "tsx": "import { KoleEmployeeCard } from 'kole-ui/react';\n\ntype EmployStatus = 'active' | 'left';\ninterface Employee {\n name: string;\n empId: string;\n dept: string;\n position: string;\n status: EmployStatus;\n tags: ReadonlyArray;\n phone?: string;\n email?: string;\n}\n\nconst employee: Employee = {\n name: '李娜',\n empId: 'E1024',\n dept: '产品中心 · 产品组',\n position: '产品经理',\n status: 'left',\n tags: ['B端', '数据'],\n phone: '138-0000-0000',\n email: 'lina@example.com',\n};\n\nfunction onEdit(e: Employee): void {\n console.log('编辑', e);\n}\n\n// showContact 打开联系方式区(电话 / 邮箱)\n", "vue3ts": "\n\n", "vue2ts": "\n\n" }, "notes": [ "依据 frameworks/EmployeeCard.html:59-79 第二张卡片(李娜 / E1024 / 产品中心 · 产品组 / 产品经理 / 离职 / B端·数据 / 电话 138-0000-0000 / 邮箱 lina@example.com)", "showContact 见 EmployeeCard.jsx 形参与 EmployeeCard.vue3.vue defineProps(对应演示页该卡片的 kole-emp-contact 区块)" ] } ], "curated": true }