{"id":28234587,"url":"https://github.com/zwingz/vue-fixed-table","last_synced_at":"2025-08-08T19:17:26.437Z","repository":{"id":57171216,"uuid":"105362907","full_name":"zWingz/vue-fixed-table","owner":"zWingz","description":"a vue table component","archived":false,"fork":false,"pushed_at":"2018-10-12T06:35:43.000Z","size":835,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T22:32:45.058Z","etag":null,"topics":["component","table","vue","vue-table"],"latest_commit_sha":null,"homepage":"https://zwing.site/vue-fixed-table/docs/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zWingz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-30T10:37:17.000Z","updated_at":"2022-04-19T16:25:42.000Z","dependencies_parsed_at":"2022-08-27T13:11:39.285Z","dependency_job_id":null,"html_url":"https://github.com/zWingz/vue-fixed-table","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/zWingz/vue-fixed-table","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zWingz%2Fvue-fixed-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zWingz%2Fvue-fixed-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zWingz%2Fvue-fixed-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zWingz%2Fvue-fixed-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zWingz","download_url":"https://codeload.github.com/zWingz/vue-fixed-table/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zWingz%2Fvue-fixed-table/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260907085,"owners_count":23080605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","table","vue","vue-table"],"created_at":"2025-05-18T22:14:01.696Z","updated_at":"2025-08-08T19:17:26.427Z","avatar_url":"https://github.com/zWingz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-table 组件\n\n[![CircleCI](https://circleci.com/gh/zWingz/vue-fixed-table.svg?style=svg)](https://circleci.com/gh/zWingz/vue-fixed-table)\n\n[Demo](https://zwing.site/vue-fixed-table/docs/)\n\n功能：\n+ 固定表格头、左侧栏\n+ 单元格整体居中，局部对齐\n+ 虚拟的横向滚动条\n\n解决问题:\n\n后台系统的列表页中,如果不做处理\n在内容过多情况下.会引起页面滚动.同时会撑开页面.\n表头/两侧会滚动条隐藏掉.不利于数据的展示\n\n解决方法:\n+ 全局滚动.(表格过大.页面整体会被撑开)\n+ 容器内滚动.(表格显得很狭窄)\n+ 垂直方向全局滚动, 水平方向是局部滚动. (请自行使用flex布局使得表格自身横向滚动,纵向自适应页面高度.页面宽度不被撑开, 加虚拟滚动条辅助时候水平滚动不需要拉到最后)\n+ 固定表格头/两侧边\n\n\n----\n## 主要依赖\n\n`vue@2.4.4`\n----\n\n## Build Setup\n\n+ git clone\n\n+ cd dir,执行\n\n    `npm install`\n    \n    完成依赖包安装\n    \n\n+ 开发环境(访问 http://localhost:8082/demo/)\n\n    `npm run dev`\n\n+ 生产环境\n\n    `npm run build`\n\n## Fixed-Table 使用\n\n固定表头, 左侧以及右侧\n\n需要通过一定的slot插入相应的内容达到固定\n\n### options\n\n|    props     | 类型           | 默认  | 描述                                                         |\n| :----------: | -------------- | ----- | ------------------------------------------------------------ |\n|  offsetTop   | String, Number | 0     | 顶部偏移                                                     |\n|  selfScroll  | Boolean        | false | 是否自滚动. 垂直滚动会依赖全局, 横向滚动会依赖自身. 所以需要额外样式是的容器能产生横向的滚动条.(DEMO 1) |\n| scrollTarget | Object, String | window    | 局部滚动容器, 可传dom元素或者选择器, 既全局滚动.(DEMO2) |\n|   useTrans   | Boolean        | false | 是否使用动画做回退方案, 在safari和firefox下会有闪动. 所以safari和firefox默认开启. |\n\n\n### slot\n\n需要通过`slot`插入到相应的插槽中, 通过对插槽的控制达到固定效果\n\n| slot       | 介绍             |\n| ---------- | ------------ |\n| leftThead  | 左侧表头     |\n| thead      | 中间表头     |\n| rightThead | 右侧表头     |\n| leftBody   | 左侧固定表体 |\n| tbody      | 表体         |\n| rightBody  | 右侧固定表体 |\n\n\n## align-cell 使用\n\n### options\n| props | 类型   | 默认 | 描述       |\n| ------- | ------ | ---- | ---------- |\n| dir     | String | 'l'  | 对齐方向   |\n| tag     | String | 'td' | 渲染的标签 |\n\n\n## scroll-x-bar 使用\n\n虚拟的横向滚动条, 需要让容易自行产生横向滚动.\n\n让容器在页面高度不足的时候, 也可以拖动横向滚动条.\n\n**一定要让容器产生横向滚动**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzwingz%2Fvue-fixed-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzwingz%2Fvue-fixed-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzwingz%2Fvue-fixed-table/lists"}