{"id":52740,"date":"2024-12-03T09:03:35","date_gmt":"2024-12-03T01:03:35","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52740\/"},"modified":"2024-12-03T09:03:35","modified_gmt":"2024-12-03T01:03:35","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-vue-%e5%b0%86%e4%b8%a4%e5%bc%a0%e5%9b%be%e7%89%87%e5%90%88%e5%b9%b6%e5%b9%b6%e9%80%82%e9%85%8d%e6%89%80%e6%9c%89%e9%a1%b5%e9%9d%a2%e5%a4%a7%e5%b0%8f%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52740\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 Vue \u5c06\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u5e76\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u4f7f\u7528 Vue \u5c06\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u5e76\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f\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\u4f7f\u7528 Vue \u5c06\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u5e76\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f\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\/20241123\/173232235467412432a12f4.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 Vue \u5c06\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u5e76\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 Vue \u5c06\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u5e76\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>vue\u4e2d\u5c06\u4e24\u5f20\u56fe\u7247\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f<\/strong><\/p>\n<p>\u60a8\u9700\u8981\u5c06\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u4e3a\u4e00\u5f20\u5e76\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f\u3002\u4f7f\u7528\u7edd\u5bf9\u5b9a\u4f4d\u53ef\u80fd\u4f1a\u5bfc\u81f4\u56fe\u7247\u5728\u4e0d\u540c\u9875\u9762\u5927\u5c0f\u4e0b\u4f4d\u7f6e\u51fa\u73b0\u504f\u79fb\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff1a<\/p>\n<p><strong>\u4f7f\u7528\u52a8\u6001\u5355\u4f4d\u548c\u54cd\u5e94\u5f0f\u8bbe\u8ba1<\/strong><\/p>\n<ul>\n<li><strong>\u52a8\u6001\u5355\u4f4d\uff1a<\/strong>\u4f7f\u7528 vw \u6216 rem \u7b49\u52a8\u6001\u5355\u4f4d\uff0c\u5b83\u4eec\u4f1a\u6839\u636e\u8bbe\u5907\u7684\u5bbd\u5ea6\u52a8\u6001\u8c03\u6574\u5143\u7d20\u7684\u5c3a\u5bf8\u3002<\/li>\n<li><strong>\u54cd\u5e94\u5f0f\u8bbe\u8ba1\uff1a<\/strong>\u4f7f\u7528 @media \u548c (max-width:365px) \u5a92\u4f53\u67e5\u8be2\u6765\u9488\u5bf9\u4e0d\u540c\u9875\u9762\u5927\u5c0f\u8fdb\u884c\u8c03\u6574\u3002<\/li>\n<\/ul>\n<p><strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre>&lt;div&gt;\n  &lt;img src=\"image1.png\" style=\"width: 50vw;\" \/&gt;\n  &lt;img src=\"image2.png\" style=\"width: 50vw; margin-left: -50vw;\" \/&gt;\n&lt;\/div&gt;\n\n@media and (max-width: 365px) {\n  div {\n    flex-direction: column;\n  }\n}<\/pre>\n<p><strong>\u52a8\u6001rem\u65b9\u5f0f\u4e4b\u4e00\uff1a<\/strong><\/p>\n<pre>function refreshrem() {\n  const whdef = 100 \/ 750;\n  const bodywidth = document.body.clientwidth;\n  const rem = whdef * bodywidth;\n  document.getelementsbytagname(\"html\")[\"0\"].style.fontsize = `${rem}px`;\n}<\/pre>\n<p><strong>css\u5b9e\u73b0\u80cc\u666f\u8f93\u5165\u6846\uff1a<\/strong><\/p>\n<pre>.input {\n  padding: 0.5rem 1rem;\n  width: 10rem;\n  height: 2.5rem;\n  background: url(url.png) no-repeat right 0.5rem center #fefdd7;\n  border: 1px solid #705048;\n  border-radius: 0.5rem;\n  box-shadow: 0px 0px 10px 0px #00000029;\n}<\/pre>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u60a8\u7684\u56fe\u7247\u53ef\u4ee5\u5408\u5e76\u5e76\u6839\u636e\u9875\u9762\u5927\u5c0f\u8fdb\u884c\u8c03\u6574\uff0c\u786e\u4fdd\u5728\u6240\u6709\u9875\u9762\u5927\u5c0f\u4e0b\u90fd\u80fd\u6b63\u5e38\u663e\u793a\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u672c\u6587\u5230\u6b64\u7ed3\u675f\uff0c\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u300a\u5982\u4f55\u4f7f\u7528 Vue \u5c06\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u5e76\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f\uff1f\u300b\uff0c\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u7ed9\u5927\u5bb6\u5206\u4eab\u66f4\u591a\u6587\u7ae0\u77e5\u8bc6\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u5982\u4f55\u9009\u62e9\u9002\u5408\u81ea\u5df1\u7684\u684c\u9762\u7535\u8111\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 Vue \u5c06\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u5e76\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f\uff1f \u4f60\u5728\u5b66\u4e60\u6587\u7ae0\u76f8\u5173\u7684\u77e5\u8bc6\u5417\uff1f\u672c\u6587\u300a\u5982\u4f55\u4f7f\u7528 Vue \u5c06\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u5e76\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f\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 vue\u4e2d\u5c06\u4e24\u5f20\u56fe\u7247\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f \u60a8\u9700\u8981\u5c06\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u4e3a\u4e00\u5f20\u5e76\u9002\u914d\u6240\u6709\u9875\u9762\u5927\u5c0f\u3002\u4f7f\u7528\u7edd\u5bf9\u5b9a\u4f4d\u53ef\u80fd\u4f1a\u5bfc\u81f4\u56fe\u7247\u5728\u4e0d\u540c\u9875\u9762\u5927\u5c0f\u4e0b\u4f4d\u7f6e\u51fa\u73b0\u504f\u79fb\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff1a \u4f7f\u7528\u52a8\u6001\u5355\u4f4d\u548c\u54cd\u5e94\u5f0f\u8bbe\u8ba1 \u52a8\u6001\u5355\u4f4d\uff1a\u4f7f\u7528 vw \u6216 rem \u7b49\u52a8\u6001\u5355\u4f4d\uff0c\u5b83\u4eec\u4f1a\u6839\u636e\u8bbe\u5907\u7684\u5bbd\u5ea6\u52a8\u6001\u8c03\u6574\u5143\u7d20\u7684\u5c3a\u5bf8\u3002 \u54cd\u5e94\u5f0f\u8bbe\u8ba1\uff1a\u4f7f\u7528 @media \u548c (max-width:365px) \u5a92\u4f53\u67e5\u8be2\u6765\u9488\u5bf9\u4e0d\u540c\u9875\u9762\u5927\u5c0f\u8fdb\u884c\u8c03\u6574\u3002 \u4ee3\u7801\u793a\u4f8b\uff1a &lt;div&gt; &lt;img src=&#8221;image1.png&#8221; style=&#8221;width: 50vw;&#8221; \/&gt; &lt;img src=&#8221;image2.png&#8221; style=&#8221;width: 50vw; margin-left: -50vw;&#8221; \/&gt; &lt;\/div&gt; @media and (max-width: 365px) { div { flex-direction: column; } } \u52a8\u6001rem\u65b9\u5f0f\u4e4b\u4e00\uff1a function refreshrem() { const whdef = 100 \/ 750; [&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-52740","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52740","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=52740"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52740\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}