{"id":25557,"date":"2024-11-24T11:42:31","date_gmt":"2024-11-24T03:42:31","guid":{"rendered":"https:\/\/fwq.ai\/blog\/25557\/"},"modified":"2024-11-24T11:42:31","modified_gmt":"2024-11-24T03:42:31","slug":"%e5%a6%82%e4%bd%95%e8%ae%a9-element-ui-%e7%9a%84-el-col-%e5%9c%a8%e8%b6%85%e8%bf%87-24-span-%e6%97%b6%e4%bf%9d%e6%8c%81%e4%b8%80%e8%a1%8c%e6%98%be%e7%a4%ba%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/25557\/","title":{"rendered":"\u5982\u4f55\u8ba9 Element UI \u7684 el-col \u5728\u8d85\u8fc7 24 span \u65f6\u4fdd\u6301\u4e00\u884c\u663e\u793a\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173063197893308.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u8ba9 Element UI \u7684 el-col \u5728\u8d85\u8fc7 24 span \u65f6\u4fdd\u6301\u4e00\u884c\u663e\u793a\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u8ba9 Element UI \u7684 el-col \u5728\u8d85\u8fc7 24 span \u65f6\u4fdd\u6301\u4e00\u884c\u663e\u793a\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u8d85\u8d8a element ui \u9650\u5236\uff0c\u8ba9 el-col \u5728\u8d85\u8fc7 24 span \u65f6\u4fdd\u6301\u4e00\u884c\u663e\u793a<\/strong><\/p>\n<p>\u4f60\u5e0c\u671b Element UI \u7684 el-col \u8d85\u8fc7 24 span \u65f6\u8fd8\u80fd\u4fdd\u6301\u5728\u4e00\u884c\u663e\u793a\uff0c\u5e76\u4e14\u53ef\u4ee5\u4f7f\u7528\u6d4f\u89c8\u5668\u6eda\u52a8\u6761\u8fdb\u884c\u62d6\u52a8\u3002\u8fd9\u662f\u7684\u9650\u5236\uff0c\u4f46\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5176\u4ed6\u65b9\u6cd5\u6765\u5b9e\u73b0\u3002<\/p>\n<p><strong>\u81ea\u5b9a\u4e49\u5b9e\u73b0<\/strong><\/p>\n<p>\u653e\u5f03\u4f7f\u7528 Element UI \u7684 el-col\uff0c\u81ea\u5df1\u5b9e\u73b0\u4e00\u4e2a\u7c7b\u4f3c\u7684\u529f\u80fd\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528 CSS Flexbox \u6216 Grid \u6765\u521b\u5efa\u81ea\u9002\u5e94\u5e03\u5c40\uff0c\u4f7f\u5176\u6839\u636e\u53ef\u7528\u7a7a\u95f4\u81ea\u52a8\u5143\u7d20\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>.my-custom-row {\n  display: flex;\n  flex-wrap: nowrap;\n  overflow-x: scroll; \/\/ \u6dfb\u52a0\u6eda\u52a8\u6761\n}\n\n.my-custom-col {\n  flex: 1 0 8rem; \/\/ \u8bbe\u7f6e\u6700\u5c0f\u5bbd\u5ea6\u4e3a 8rem\n  margin: 0 1rem; \/\/ \u6dfb\u52a0\u95f4\u8ddd\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7136\u540e\uff0c\u5728 Vue \u4e2d\u4f7f\u7528\u81ea\u5b9a\u4e49\u7ec4\u4ef6\uff1a<\/p>\n<pre>&lt;template&gt;\n  &lt;div class=\"my-custom-row\"&gt;\n    &lt;my-custom-col&gt;&lt;\/my-custom-col&gt;\n    &lt;my-custom-col&gt;&lt;\/my-custom-col&gt;\n    ...\n  &lt;\/div&gt;\n&lt;\/template&gt;\n\n&lt;script&gt;\nexport default {\n  components: {\n    MyCustomCol: {\n      template: `&lt;div&gt;\u5185\u5bb9&lt;\/div&gt;`\n    }\n  }\n}\n&lt;\/script&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u6837\uff0c\u5143\u7d20\u5c31\u4f1a\u4fdd\u6301\u5728\u4e00\u884c\u663e\u793a\uff0c\u5e76\u4e14\u4e0d\u4f1a\u8d85\u51fa\u53ef\u7528\u5bbd\u5ea6\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u8ba9 Element UI \u7684 el-col \u5728\u8d85\u8fc7 24 span \u65f6\u4fdd\u6301\u4e00\u884c\u663e\u793a\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>\u8d85\u8d8a element ui \u9650\u5236\uff0c\u8ba9 el-col \u5728\u8d85\u8fc7 24 span \u65f6\u4fdd\u6301\u4e00\u884c\u663e\u793a \u4f60\u5e0c\u671b Element UI \u7684 el-col \u8d85\u8fc7 24 span \u65f6\u8fd8\u80fd\u4fdd\u6301\u5728\u4e00\u884c\u663e\u793a\uff0c\u5e76\u4e14\u53ef\u4ee5\u4f7f\u7528\u6d4f\u89c8\u5668\u6eda\u52a8\u6761\u8fdb\u884c\u62d6\u52a8\u3002\u8fd9\u662f\u7684\u9650\u5236\uff0c\u4f46\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5176\u4ed6\u65b9\u6cd5\u6765\u5b9e\u73b0\u3002 \u81ea\u5b9a\u4e49\u5b9e\u73b0 \u653e\u5f03\u4f7f\u7528 Element UI \u7684 el-col\uff0c\u81ea\u5df1\u5b9e\u73b0\u4e00\u4e2a\u7c7b\u4f3c\u7684\u529f\u80fd\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528 CSS Flexbox \u6216 Grid \u6765\u521b\u5efa\u81ea\u9002\u5e94\u5e03\u5c40\uff0c\u4f7f\u5176\u6839\u636e\u53ef\u7528\u7a7a\u95f4\u81ea\u52a8\u5143\u7d20\u3002\u4f8b\u5982\uff1a .my-custom-row { display: flex; flex-wrap: nowrap; overflow-x: scroll; \/\/ \u6dfb\u52a0\u6eda\u52a8\u6761 } .my-custom-col { flex: 1 0 8rem; \/\/ \u8bbe\u7f6e\u6700\u5c0f\u5bbd\u5ea6\u4e3a 8rem margin: 0 1rem; \/\/ \u6dfb\u52a0\u95f4\u8ddd } [&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-25557","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25557","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=25557"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25557\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=25557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=25557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=25557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}