{"id":2434,"date":"2024-11-10T09:25:48","date_gmt":"2024-11-10T01:25:48","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2434\/"},"modified":"2024-11-10T09:25:48","modified_gmt":"2024-11-10T01:25:48","slug":"%e8%ae%a9%e6%88%91%e4%bb%ac%e5%8f%aa%e7%94%a8%e4%b8%80%e6%a0%b9%e5%ae%89%e8%a3%85%e7%ba%bf%e5%b0%b1%e5%8f%af%e4%bb%a5%e4%bd%bf%e7%bd%91%e7%bb%9c%e5%93%8d%e5%ba%94%e8%b5%b7%e6%9d%a5%e5%90%97%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2434\/","title":{"rendered":"\u8ba9\u6211\u4eec\u53ea\u7528\u4e00\u6839\u5b89\u88c5\u7ebf\u5c31\u53ef\u4ee5\u4f7f\u7f51\u7edc\u54cd\u5e94\u8d77\u6765\u5417\uff1f\u6211\u6b63\u5728\u5bfb\u627e\u8d21\u732e\u8005\uff01"},"content":{"rendered":"<p>\u6700\u8fd1\u6211\u53d1\u5e03\u4e86\u4e00\u4e2a npm \u5305\uff0c\u5176\u4f7f\u547d\u5982\u6807\u9898\u6240\u793a\uff1a\u8ba9\u9879\u76ee\u53ea\u9700\u4e00\u884c\u4ee3\u7801\u5373\u53ef\u54cd\u5e94\uff01<\/p>\n<p>\u6211\u4e0e\u60a8\u5206\u4eab\u54cd\u5e94\u5f0f\u5e94\u7528\u7a0b\u5e8f [beta] \u5305<\/p>\n<p>\u6211\u82b1\u4e86\u51e0\u5e74\u65f6\u95f4\u5c1d\u8bd5\u548c\u5f00\u53d1\u8fd9\u9879\u6280\u672f\uff0c\u76ee\u524d\u5305\u62ec\uff1a<\/p>\n<ol>\n<li>\u52a8\u6001\u8bbe\u7f6e html \u6807\u7b7e\u5b57\u4f53\u5927\u5c0f\uff08\u901a\u8fc7 js \u811a\u672c\uff09\uff0c\u8003\u8651\uff1a(1) \u5c4f\u5e55\u5206\u8fa8\u7387\u548c (2) \u6d4f\u89c8\u5668\u5b57\u4f53\u5927\u5c0f\uff08\u7528\u4e8e\u7f51\u7edc\u53ef\u8bbf\u95ee\u6027\uff09<\/li>\n<li>\u5c06\u50cf\u7d20\u5b9a\u4e49\u9884\u5904\u7406\u4e3a rem<\/li>\n<li>\u96c6\u4e2d\u79fb\u52a8\u5c4f\u5e55\u4e2d\u7684\u5143\u7d20\uff08\u5b9e\u9a8c\u529f\u80fd\uff09<\/li>\n<\/ol>\n<p>\u7ed3\u679c\u662f\u6240\u6709\u5143\u7d20\u6bd4\u4f8b\u548c\u76f8\u5bf9\u5927\u5c0f\u5728\u6240\u6709\u5c4f\u5e55\u5206\u8fa8\u7387\u4e0a\u90fd\u76f8\u540c\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173076606370872.gif\" style=\"max-width:90%\" class=\"aligncenter\" title=\"\u8ba9\u6211\u4eec\u53ea\u7528\u4e00\u6839\u5b89\u88c5\u7ebf\u5c31\u53ef\u4ee5\u4f7f\u7f51\u7edc\u54cd\u5e94\u8d77\u6765\u5417\uff1f\u6211\u6b63\u5728\u5bfb\u627e\u8d21\u732e\u8005\uff01\u63d2\u56fe\" alt=\"\u8ba9\u6211\u4eec\u53ea\u7528\u4e00\u6839\u5b89\u88c5\u7ebf\u5c31\u53ef\u4ee5\u4f7f\u7f51\u7edc\u54cd\u5e94\u8d77\u6765\u5417\uff1f\u6211\u6b63\u5728\u5bfb\u627e\u8d21\u732e\u8005\uff01\u63d2\u56fe\" \/><\/p>\n<p>\u53ea\u9700\u4e00\u884c\u5b89\u88c5\uff0c\u4f8b\u5982\u4f7f\u7528 rollup\uff1a<\/p>\n<pre>import responsive from 'rollup-plugin-responsive-app'\n\nexport default {\n   \u2026\n   plugins: [\n   \u2026,\n   \/\/ last plugin on the list\n   responsive()\n   ],\n};\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6216\u8005\u5c06\u6d4f\u89c8\u5668\u6346\u7ed1\u7248\u672c\u653e\u5165\u9875\u9762\uff1a<\/p>\n<pre>&lt;head&gt;\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/responsive-app@1.0.7-beta.0\/dist\/browser-bundle.min.js\"&gt;&lt;\/script&gt;\n&lt;\/head&gt;\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u91cc\u7684\u4e3b\u8981\u76ee\u6807\u662f\u5728\u521b\u5efa\u65b0\u9879\u76ee\u65f6\u8282\u7701\u65f6\u95f4\uff0c\u6839\u672c\u4e0d\u9700\u8981\u5904\u7406\u54cd\u5e94\u80fd\u529b\uff0c\u53ea\u9700\u76f8\u4fe1\u754c\u9762\u5728\u6240\u6709\u5c4f\u5e55\u5206\u8fa8\u7387\u4e0a\u90fd\u4f1a\u770b\u8d77\u6765\u4e0d\u9519\u3002\u542c\u8d77\u6765\u4e0d\u9519\u5427\uff1f<\/p>\n<p>\u6240\u4ee5\uff0c\u5728\u63a8\u51fa\u8fd9\u4e2a\u6d4b\u8bd5\u7248\u672c\u540e\uff0c\u6211\u6b63\u5728\u5bfb\u627e\u652f\u6301\u548c\u8d21\u732e\u8005\u3002\u6700\u521d\uff0c\u6211\u4eec\u7684\u60f3\u6cd5\u662f\u5728\u4e0d\u540c\u7684\u4e0a\u4e0b\u6587\u3001\u9879\u76ee\u548c\u6846\u67b6\uff08react\u3001angular\u3001\u2026\uff09\u4e2d\u6d4b\u8bd5\u8fd9\u4e2a\u5305\uff0c\u4ee5\u4f7f\u8be5\u8fc7\u7a0b\u5c3d\u53ef\u80fd\u5168\u9762\u3002<\/p>\n<p>\u8c01\u51c6\u5907\u597d\u8fce\u63a5\u8fd9\u4e2a\u6311\u6218\uff1f\u6d4b\u8bd5\u6b65\u9aa4\u4e3a\uff1a<\/p>\n<ol>\n<li>\u5c06\u811a\u672c\u6807\u7b7e\u5b89\u88c5\u6216\u6dfb\u52a0\u5230\u60a8\u7684\u65b0\u5e94\u7528\u7a0b\u5e8f\u6216\u73b0\u6709\u5e94\u7528\u7a0b\u5e8f\u4e2d 1.1 \u5982\u679c\u60a8\u6709\u73b0\u6709\u7684\u54cd\u5e94\u5f0f\u89c4\u5219\uff0c\u8bf7\u7ed5\u8fc7\u5b83\u4eec<\/li>\n<li>\u8de8\u591a\u79cd\u5206\u8fa8\u7387\u68c0\u67e5\u60a8\u7684\u754c\u9762<\/li>\n<li>\u8ba9\u6211\u77e5\u9053\u5b83\u5bf9\u4f60\u6709\u4ec0\u4e48\u4f5c\u7528:)<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u5c31\u662f\u8ba9\u6211\u4eec\u53ea\u7528\u4e00\u6839\u5b89\u88c5\u7ebf\u5c31\u53ef\u4ee5\u4f7f\u7f51\u7edc\u54cd\u5e94\u8d77\u6765\u5417\uff1f\u6211\u6b63\u5728\u5bfb\u627e\u8d21\u732e\u8005\uff01\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>\u6700\u8fd1\u6211\u53d1\u5e03\u4e86\u4e00\u4e2a npm \u5305\uff0c\u5176\u4f7f\u547d\u5982\u6807\u9898\u6240\u793a\uff1a\u8ba9\u9879\u76ee\u53ea\u9700\u4e00\u884c\u4ee3\u7801\u5373\u53ef\u54cd\u5e94\uff01 \u6211\u4e0e\u60a8\u5206\u4eab\u54cd\u5e94\u5f0f\u5e94\u7528\u7a0b\u5e8f [beta] \u5305 \u6211\u82b1\u4e86\u51e0\u5e74\u65f6\u95f4\u5c1d\u8bd5\u548c\u5f00\u53d1\u8fd9\u9879\u6280\u672f\uff0c\u76ee\u524d\u5305\u62ec\uff1a \u52a8\u6001\u8bbe\u7f6e html \u6807\u7b7e\u5b57\u4f53\u5927\u5c0f\uff08\u901a\u8fc7 js \u811a\u672c\uff09\uff0c\u8003\u8651\uff1a(1) \u5c4f\u5e55\u5206\u8fa8\u7387\u548c (2) \u6d4f\u89c8\u5668\u5b57\u4f53\u5927\u5c0f\uff08\u7528\u4e8e\u7f51\u7edc\u53ef\u8bbf\u95ee\u6027\uff09 \u5c06\u50cf\u7d20\u5b9a\u4e49\u9884\u5904\u7406\u4e3a rem \u96c6\u4e2d\u79fb\u52a8\u5c4f\u5e55\u4e2d\u7684\u5143\u7d20\uff08\u5b9e\u9a8c\u529f\u80fd\uff09 \u7ed3\u679c\u662f\u6240\u6709\u5143\u7d20\u6bd4\u4f8b\u548c\u76f8\u5bf9\u5927\u5c0f\u5728\u6240\u6709\u5c4f\u5e55\u5206\u8fa8\u7387\u4e0a\u90fd\u76f8\u540c\uff1a \u53ea\u9700\u4e00\u884c\u5b89\u88c5\uff0c\u4f8b\u5982\u4f7f\u7528 rollup\uff1a import responsive from &#8216;rollup-plugin-responsive-app&#8217; export default { \u2026 plugins: [ \u2026, \/\/ last plugin on the list responsive() ], }; \u767b\u5f55\u540e\u590d\u5236 \u6216\u8005\u5c06\u6d4f\u89c8\u5668\u6346\u7ed1\u7248\u672c\u653e\u5165\u9875\u9762\uff1a &lt;head&gt; &lt;script src=&#8221;https:\/\/cdn.jsdelivr.net\/npm\/responsive-app@1.0.7-beta.0\/dist\/browser-bundle.min.js&#8221;&gt;&lt;\/script&gt; &lt;\/head&gt; \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u91cc\u7684\u4e3b\u8981\u76ee\u6807\u662f\u5728\u521b\u5efa\u65b0\u9879\u76ee\u65f6\u8282\u7701\u65f6\u95f4\uff0c\u6839\u672c\u4e0d\u9700\u8981\u5904\u7406\u54cd\u5e94\u80fd\u529b\uff0c\u53ea\u9700\u76f8\u4fe1\u754c\u9762\u5728\u6240\u6709\u5c4f\u5e55\u5206\u8fa8\u7387\u4e0a\u90fd\u4f1a\u770b\u8d77\u6765\u4e0d\u9519\u3002\u542c\u8d77\u6765\u4e0d\u9519\u5427\uff1f \u6240\u4ee5\uff0c\u5728\u63a8\u51fa\u8fd9\u4e2a\u6d4b\u8bd5\u7248\u672c\u540e\uff0c\u6211\u6b63\u5728\u5bfb\u627e\u652f\u6301\u548c\u8d21\u732e\u8005\u3002\u6700\u521d\uff0c\u6211\u4eec\u7684\u60f3\u6cd5\u662f\u5728\u4e0d\u540c\u7684\u4e0a\u4e0b\u6587\u3001\u9879\u76ee\u548c\u6846\u67b6\uff08react\u3001angular\u3001\u2026\uff09\u4e2d\u6d4b\u8bd5\u8fd9\u4e2a\u5305\uff0c\u4ee5\u4f7f\u8be5\u8fc7\u7a0b\u5c3d\u53ef\u80fd\u5168\u9762\u3002 \u8c01\u51c6\u5907\u597d\u8fce\u63a5\u8fd9\u4e2a\u6311\u6218\uff1f\u6d4b\u8bd5\u6b65\u9aa4\u4e3a\uff1a \u5c06\u811a\u672c\u6807\u7b7e\u5b89\u88c5\u6216\u6dfb\u52a0\u5230\u60a8\u7684\u65b0\u5e94\u7528\u7a0b\u5e8f\u6216\u73b0\u6709\u5e94\u7528\u7a0b\u5e8f\u4e2d 1.1 \u5982\u679c\u60a8\u6709\u73b0\u6709\u7684\u54cd\u5e94\u5f0f\u89c4\u5219\uff0c\u8bf7\u7ed5\u8fc7\u5b83\u4eec \u8de8\u591a\u79cd\u5206\u8fa8\u7387\u68c0\u67e5\u60a8\u7684\u754c\u9762 [&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-2434","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2434","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=2434"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2434\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}