{"id":53029,"date":"2024-12-03T11:38:41","date_gmt":"2024-12-03T03:38:41","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53029\/"},"modified":"2024-12-03T11:38:41","modified_gmt":"2024-12-03T03:38:41","slug":"%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%88%b6%e5%85%83%e7%b4%a0%e5%86%85%e5%ad%90%e5%85%83%e7%b4%a0%e4%b8%a4%e8%a1%8c%e6%8e%92%e5%88%97%ef%bc%8c%e8%b6%85%e5%87%ba%e9%83%a8%e5%88%86%e9%9a%90%e8%97%8f-4","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53029\/","title":{"rendered":"\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u5185\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\uff0c\u8d85\u51fa\u90e8\u5206\u9690\u85cf\u5e76\u663e\u793a\u7701\u7565\u53f7\u6309\u94ae\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u5185\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\uff0c\u8d85\u51fa\u90e8\u5206\u9690\u85cf\u5e76\u663e\u793a\u7701\u7565\u53f7\u6309\u94ae\uff1f <\/h1>\n<p>\u4f60\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u7684\u77e5\u8bc6\u5417\uff1f\u672c\u6587<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u5185\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\uff0c\u8d85\u51fa\u90e8\u5206\u9690\u85cf\u5e76\u663e\u793a\u7701\u7565\u53f7\u6309\u94ae\uff1f \u300b<\/span>\uff0c\u4e3b\u8981\u4ecb\u7ecd\u7684\u5185\u5bb9\u5c31\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u5982\u679c\u4f60\u60f3\u63d0\u5347\u81ea\u5df1\u7684\u5f00\u53d1\u80fd\u529b\uff0c\u5c31\u4e0d\u8981\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5927\u5bb6\u8981\u77e5\u9053\u7f16\u7a0b\u7406\u8bba\u57fa\u7840\u548c\u5b9e\u6218\u64cd\u4f5c\u90fd\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u54e6\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241125\/1732539634674474f2411d0.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u5185\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\uff0c\u8d85\u51fa\u90e8\u5206\u9690\u85cf\u5e76\u663e\u793a\u7701\u7565\u53f7\u6309\u94ae\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u5185\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\uff0c\u8d85\u51fa\u90e8\u5206\u9690\u85cf\u5e76\u663e\u793a\u7701\u7565\u53f7\u6309\u94ae\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728\u7236\u5143\u7d20\u5185\u5b9e\u73b0\u5b50\u5143\u7d20\u7684\u4e24\u884c\u6392\u5217\uff1f<\/strong><\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong><\/p>\n<p>\u6211\u60f3\u5728\u7ea2\u8272\u6846\u5f62\u7236\u5143\u7d20\u5185\u6392\u5217\u5b50\u5143\u7d20\uff0c\u4f7f\u5b83\u4eec\u5f62\u6210\u4e24\u884c\u3002\u5f53\u8d85\u51fa\u7236\u5143\u7d20\u8303\u56f4\u65f6\uff0c\u521d\u59cb\u72b6\u6001\u4e0b\u9690\u85cf\u591a\u4f59\u5185\u5bb9\uff0c\u5e76\u663e\u793a\u7701\u7565\u53f7\u6309\u94ae\u3002\u70b9\u51fb\u8be5\u6309\u94ae\u65f6\uff0c\u9690\u85cf\u5185\u5bb9\u5c06\u5c55\u5f00\uff0c\u5e76\u51fa\u73b0\u6c34\u5e73\u6eda\u52a8\u6761\u3002<\/p>\n<p><strong>\u5728\u7ebf\u6f14\u793a<\/strong><\/p>\n<p><strong>HTML\uff1a<\/strong><\/p>\n<pre>&lt;div id=\"container\" class=\"hidden\"&gt;\n  &lt;div id=\"flex-container\"&gt;\n    &lt;div class=\"item\"&gt;item1&lt;\/div&gt;\n    &lt;div class=\"item\"&gt;item2&lt;\/div&gt;\n    &lt;div class=\"item\"&gt;item3&lt;\/div&gt;\n    &lt;div class=\"item\"&gt;item4&lt;\/div&gt;\n    &lt;div class=\"item\"&gt;item5&lt;\/div&gt;\n    &lt;div class=\"item\"&gt;item6&lt;\/div&gt;\n    &lt;div class=\"item\"&gt;item7&lt;\/div&gt;\n    &lt;div class=\"item\"&gt;item8&lt;\/div&gt;\n    &lt;div class=\"item\"&gt;item9&lt;\/div&gt;\n    &lt;div class=\"item\"&gt;item10&lt;\/div&gt;\n    &lt;div id=\"more\"&gt;...&lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n<p><strong>CSS\uff1a<\/strong><\/p>\n<pre>#container {\n  width: 400px;\n  height: 200px;\n  border: 1px solid red;\n  position: relative;\n}\n\n#container.hidden {\n  overflow-x: hidden;\n  overflow-y: hidden;\n}\n\n#container.scroll {\n  overflow-x: scroll;\n  overflow-y: hidden;\n}\n\n#flex-container {\n  width: 800px;\n  height: 200px;\n  background: pink;\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: space-around;\n}\n\n#flex-container .item {\n  width: 150px;\n  text-align: center;\n  background: yellow;\n  height: 94px;\n  display: flex-item;\n}\n\n#more {\n  display: block;\n  position: absolute;\n  top: 160px;\n  right: 10px;\n  z-index: 5;\n  width: 80px;\n  height: 30px;\n  background: green;\n  border-radius: 5px;\n  text-align: center;\n  color: white;\n  cursor: pointer;\n}<\/pre>\n<p><strong>JavaScript\uff1a<\/strong><\/p>\n<pre>document.getElementById(\"more\").onclick = function() {\n  this.style.display = \"none\";\n  document.getElementById(\"container\").className = \"scroll\";\n}<\/pre>\n<p><strong>\u57fa\u672c\u539f\u7406\uff1a<\/strong><\/p>\n<ol>\n<li>\u5728\u5bb9\u5668 Div \u4e2d\u653e\u7f6e\u4e00\u4e2a\u5305\u542b\u5b50\u5143\u7d20\u7684 flex \u5bb9\u5668\u3002\u5bb9\u5668 Div \u8bbe\u7f6e\u4e3a\u9690\u85cf\u8d85\u51fa\u90e8\u5206\u3002<\/li>\n<li>\u6dfb\u52a0\u4e00\u4e2a\u201c\u66f4\u591a\u201d\u6309\u94ae\uff0c\u5f53\u70b9\u51fb\u65f6\uff0c\u5c06\u5bb9\u5668 Div \u8bbe\u4e3a\u53ef\u6eda\u52a8\uff0c\u5141\u8bb8\u67e5\u770b\u9690\u85cf\u7684\u5185\u5bb9\u3002<\/li>\n<li>\u4f7f\u7528 JavaScript \u786e\u5b9a\u4f55\u65f6\u663e\u793a\u201c\u66f4\u591a\u201d\u6309\u94ae\uff0c\u4f8b\u5982\u5f53 flex \u5bb9\u5668\u5bbd\u4e8e\u5bb9\u5668 Div \u65f6\u3002<\/li>\n<\/ol>\n<p>\u6587\u4e2d\u5173\u4e8e\u7684\u77e5\u8bc6\u4ecb\u7ecd\uff0c\u5e0c\u671b\u5bf9\u4f60\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\uff01\u82e5\u662f\u53d7\u76ca\u532a\u6d45\uff0c\u90a3\u5c31\u52a8\u52a8\u9f20\u6807\u6536\u85cf\u8fd9\u7bc7\u300a\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u5185\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\uff0c\u8d85\u51fa\u90e8\u5206\u9690\u85cf\u5e76\u663e\u793a\u7701\u7565\u53f7\u6309\u94ae\uff1f \u300b\u6587\u7ae0\u5427\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u4e86\u89e3\u76f8\u5173\u6280\u672f\u6587\u7ae0\u3002<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   Vue3 \u54cd\u5e94\u5f0f\u7cfb\u7edf\u4e2d\u4f7f\u7528 Reflect.set \u8bbe\u7f6e\u5bf9\u8c61\u5c5e\u6027\u65f6\uff0c\u5982\u4f55\u786e\u4fdd\u6240\u6709\u66f4\u65b0\u90fd\u88ab\u6b63\u786e\u89e6\u53d1\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u5185\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\uff0c\u8d85\u51fa\u90e8\u5206\u9690\u85cf\u5e76\u663e\u793a\u7701\u7565\u53f7\u6309\u94ae\uff1f \u4f60\u5728\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u7684\u77e5\u8bc6\u5417\uff1f\u672c\u6587\u300a\u5982\u4f55\u5b9e\u73b0\u7236\u5143\u7d20\u5185\u5b50\u5143\u7d20\u4e24\u884c\u6392\u5217\uff0c\u8d85\u51fa\u90e8\u5206\u9690\u85cf\u5e76\u663e\u793a\u7701\u7565\u53f7\u6309\u94ae\uff1f \u300b\uff0c\u4e3b\u8981\u4ecb\u7ecd\u7684\u5185\u5bb9\u5c31\u6d89\u53ca\u5230\uff0c\u5982\u679c\u4f60\u60f3\u63d0\u5347\u81ea\u5df1\u7684\u5f00\u53d1\u80fd\u529b\uff0c\u5c31\u4e0d\u8981\u9519\u8fc7\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5927\u5bb6\u8981\u77e5\u9053\u7f16\u7a0b\u7406\u8bba\u57fa\u7840\u548c\u5b9e\u6218\u64cd\u4f5c\u90fd\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u54e6\uff01 \u5982\u4f55\u5728\u7236\u5143\u7d20\u5185\u5b9e\u73b0\u5b50\u5143\u7d20\u7684\u4e24\u884c\u6392\u5217\uff1f \u95ee\u9898\uff1a \u6211\u60f3\u5728\u7ea2\u8272\u6846\u5f62\u7236\u5143\u7d20\u5185\u6392\u5217\u5b50\u5143\u7d20\uff0c\u4f7f\u5b83\u4eec\u5f62\u6210\u4e24\u884c\u3002\u5f53\u8d85\u51fa\u7236\u5143\u7d20\u8303\u56f4\u65f6\uff0c\u521d\u59cb\u72b6\u6001\u4e0b\u9690\u85cf\u591a\u4f59\u5185\u5bb9\uff0c\u5e76\u663e\u793a\u7701\u7565\u53f7\u6309\u94ae\u3002\u70b9\u51fb\u8be5\u6309\u94ae\u65f6\uff0c\u9690\u85cf\u5185\u5bb9\u5c06\u5c55\u5f00\uff0c\u5e76\u51fa\u73b0\u6c34\u5e73\u6eda\u52a8\u6761\u3002 \u5728\u7ebf\u6f14\u793a HTML\uff1a &lt;div id=&#8221;container&#8221; class=&#8221;hidden&#8221;&gt; &lt;div id=&#8221;flex-container&#8221;&gt; &lt;div class=&#8221;item&#8221;&gt;item1&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;item2&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;item3&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;item4&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;item5&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;item6&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;item7&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;item8&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;item9&lt;\/div&gt; &lt;div class=&#8221;item&#8221;&gt;item10&lt;\/div&gt; &lt;div id=&#8221;more&#8221;&gt;&#8230;&lt;\/div&gt; &lt;\/div&gt; &lt;\/div&gt; CSS\uff1a #container { width: 400px; height: 200px; border: 1px solid red; position: relative; } #container.hidden { overflow-x: hidden; [&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-53029","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53029","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=53029"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53029\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}