{"id":25383,"date":"2024-11-24T08:31:41","date_gmt":"2024-11-24T00:31:41","guid":{"rendered":"https:\/\/fwq.ai\/blog\/25383\/"},"modified":"2024-11-24T08:31:41","modified_gmt":"2024-11-24T00:31:41","slug":"element-ui-el-table-%e6%a0%91%e5%bd%a2%e7%bb%93%e6%9e%84%e5%ad%90%e8%8a%82%e7%82%b9%e6%97%a0%e6%b3%95%e6%89%93%e5%8b%be%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/25383\/","title":{"rendered":"Element-UI el-table \u6811\u5f62\u7ed3\u6784\u5b50\u8282\u70b9\u65e0\u6cd5\u6253\u52fe\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173060391799541.jpg\" class=\"aligncenter\" title=\"Element-UI el-table \u6811\u5f62\u7ed3\u6784\u5b50\u8282\u70b9\u65e0\u6cd5\u6253\u52fe\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"Element-UI el-table \u6811\u5f62\u7ed3\u6784\u5b50\u8282\u70b9\u65e0\u6cd5\u6253\u52fe\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>element-ui el-table \u6811\u5f62\u7ed3\u6784\u5b50\u8282\u70b9\u4e0d\u80fd\u6253\u52fe<\/strong><\/p>\n<p><strong>\u95ee\u9898\u63cf\u8ff0\uff1a<\/strong><\/p>\n<p>\u5728 element-ui \u7684 el-table \u6811\u5f62\u7ed3\u6784\u4e2d\uff0c\u70b9\u51fb\u5b50\u8282\u70b9\u65f6\uff0c\u53ef\u4ee5\u9009\u4e2d\u4f46\u4e0d\u4f1a\u51fa\u73b0\u6253\u52fe\u6548\u679c\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u9700\u8981\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li> <strong>\u786e\u4fdd\u4f7f\u7528 element-ui \u7684\u6700\u65b0\u7248\u672c\uff1a<\/strong> element-ui \u7248\u672c\u95ee\u9898\u53ef\u80fd\u5bfc\u81f4\u6b64\u95ee\u9898\u3002\u5efa\u8bae\u5347\u7ea7\u5230\u6700\u65b0\u7248\u672c\u3002<\/li>\n<li> <strong>\u81ea\u5b9a\u4e49  \u6837\u5f0f\uff1a<\/strong> \u6dfb\u52a0\u4ee5\u4e0b css \u6837\u5f0f\u4ee5\u81ea\u5b9a\u4e49\u9009\u4e2d\u884c\u7684\u6837\u5f0f\uff1a<\/li>\n<\/ol>\n<pre>::v-deep .indeterminate .el-table-column--selection .cell .el-checkbox {\n    display: block !important;\n}\n\n::v-deep .indeterminate .el-checkbox__input .el-checkbox__inner {\n    background-color: #4a97eb !important;\n    border-color: #4a97eb !important;\n    color: #fff !important;\n}\n\n::v-deep .indeterminate .el-checkbox__input.is-checked .el-checkbox__inner::after {\n    transform: scale(0.5);\n}\n\n::v-deep .indeterminate .el-checkbox__input .el-checkbox__inner::after {\n    border-color: #c0c4cc !important;\n    background-color: #c0c4cc;\n}\n\n::v-deep .indeterminate .el-checkbox__input .el-checkbox__inner::after {\n    content: \"\";\n    position: absolute;\n    display: block;\n    background-color: #fff;\n    height: 2px;\n    transform: scale(0.5);\n    left: 0;\n    right: 0;\n    top: 5px;\n    width: auto !important;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li> <strong>\u66f4\u65b0\u9009\u4e2d\u884c\u7684\u6837\u5f0f\uff1a<\/strong> \u8bbe\u7f6e .row-class-name prop \u4ee5\u81ea\u5b9a\u4e49\u9009\u4e2d\u884c\u7684\u6837\u5f0f\u7c7b\u540d\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b css \u6837\u5f0f\uff1a<\/li>\n<\/ol>\n<pre>::v-deep .indeterminate {\n    background-color: #f5f5f5;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u95ee\u9898\u8865\u5145\uff1a\u9009\u4e2d\u7684\u8282\u70b9\u4e2d\u51fa\u73b0\u4e00\u534a\u52fe\u9009\u7684\u72b6\u6001<\/strong><\/p>\n<p>\u5982\u679c\u9009\u4e2d\u884c\u540e\u51fa\u73b0\u4e00\u534a\u52fe\u9009\u7684\u72b6\u6001\uff0c\u53ef\u4ee5\u6309\u4ee5\u4e0b\u6b65\u9aa4\u89e3\u51b3\uff1a<\/p>\n<ol>\n<li> <strong>\u8bbe\u7f6e :row-key prop<\/strong>\uff1a\u786e\u4fdd\u4e3a\u6bcf\u4e2a\u884c\u8bbe\u7f6e\u552f\u4e00\u952e\uff0c\u4ee5\u4fbf el-table \u6b63\u786e\u8ddf\u8e2a\u9009\u4e2d\u7684\u884c\u3002<\/li>\n<li> <strong>\u81ea\u5b9a\u4e49 handleselectionchange \u4e8b\u4ef6<\/strong>\uff1a\u5728 handleselectionchange \u4e8b\u4ef6\u4e2d\uff0c\u5224\u65ad\u6240\u9009\u884c\u7684\u6570\u91cf\u5e76\u66f4\u65b0\u9009\u4e2d\u884c\u7684 isselect \u72b6\u6001\u3002<\/li>\n<li> <strong>\u81ea\u52a8\u9009\u4e2d\u5b50\u8282\u70b9\uff1a<\/strong>\u5982\u679c\u9009\u4e2d\u7236\u8282\u70b9\uff0c\u5219\u81ea\u52a8\u9009\u4e2d\u6240\u6709\u5b50\u8282\u70b9\u3002<\/li>\n<\/ol>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u53ef\u4ee5\u89e3\u51b3 el-table \u6811\u5f62\u7ed3\u6784\u5b50\u8282\u70b9\u4e0d\u80fd\u6253\u52fe\u4ee5\u53ca\u9009\u4e2d\u8282\u70b9\u51fa\u73b0\u4e00\u534a\u52fe\u9009\u72b6\u6001\u7684\u95ee\u9898\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fElement-UI el-table \u6811\u5f62\u7ed3\u6784\u5b50\u8282\u70b9\u65e0\u6cd5\u6253\u52fe\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>element-ui el-table \u6811\u5f62\u7ed3\u6784\u5b50\u8282\u70b9\u4e0d\u80fd\u6253\u52fe \u95ee\u9898\u63cf\u8ff0\uff1a \u5728 element-ui \u7684 el-table \u6811\u5f62\u7ed3\u6784\u4e2d\uff0c\u70b9\u51fb\u5b50\u8282\u70b9\u65f6\uff0c\u53ef\u4ee5\u9009\u4e2d\u4f46\u4e0d\u4f1a\u51fa\u73b0\u6253\u52fe\u6548\u679c\u3002 \u89e3\u51b3\u65b9\u6848\uff1a \u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u9700\u8981\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a \u786e\u4fdd\u4f7f\u7528 element-ui \u7684\u6700\u65b0\u7248\u672c\uff1a element-ui \u7248\u672c\u95ee\u9898\u53ef\u80fd\u5bfc\u81f4\u6b64\u95ee\u9898\u3002\u5efa\u8bae\u5347\u7ea7\u5230\u6700\u65b0\u7248\u672c\u3002 \u81ea\u5b9a\u4e49 \u6837\u5f0f\uff1a \u6dfb\u52a0\u4ee5\u4e0b css \u6837\u5f0f\u4ee5\u81ea\u5b9a\u4e49\u9009\u4e2d\u884c\u7684\u6837\u5f0f\uff1a ::v-deep .indeterminate .el-table-column&#8211;selection .cell .el-checkbox { display: block !important; } ::v-deep .indeterminate .el-checkbox__input .el-checkbox__inner { background-color: #4a97eb !important; border-color: #4a97eb !important; color: #fff !important; } ::v-deep .indeterminate .el-checkbox__input.is-checked .el-checkbox__inner::after { transform: scale(0.5); } ::v-deep [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-25383","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=25383"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25383\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=25383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=25383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=25383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}