{"id":433,"date":"2023-06-19T21:02:40","date_gmt":"2023-06-19T13:02:40","guid":{"rendered":"https:\/\/www.gzlcy.cn\/?p=433"},"modified":"2023-06-19T21:02:40","modified_gmt":"2023-06-19T13:02:40","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91%e4%b8%ad%e7%9a%84%e6%a8%a1%e5%9d%97%e5%8c%96","status":"publish","type":"post","link":"http:\/\/www.gzlcy.cn\/?p=433","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u7684\u6a21\u5757\u5316"},"content":{"rendered":"<p><img src='http:\/\/mmbiz.qpic.cn\/mmbiz_gif\/tnSlbuRyZ9Vbrv5D7VnAibD1qZTibh6Dr1vqcBczPqWsI82H74NZZgcEqMHQxObJWsLQFsWibRMicNSqTc4et3RRHg\/0?wx_fmt=gif' alt='\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f15\u5165vue.js_\u5fae\u4fe1\u5c0f\u7a0b\u5e8fmd5.js_\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f15\u5165js' \/><\/p>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u5148\u8bf4\u4e2a\u9898\u5916\u8bdd\uff0c\u7531\u4e8e\u5c0f\u7f16\u524d\u6bb5\u65f6\u95f4\u4e00\u76f4\u5f88\u5fd9\uff0c\u5bfc\u81f4\u672c\u516c\u4f17\u53f7\u6401\u7f6e\u66f4\u65b0\u4e86\u4e00\u6bb5\u65f6\u95f4\uff0c\u4ece\u4eca\u5929\u5f00\u59cb\uff0c\u5c0f\u7f16\u5c06\u9646\u7eed\u53d1\u5e03\u4e00\u4e9b\u6709\u5173\u5fae\u4fe1\u5c0f<a href='https:\/\/www.gzlcy.cn\/?p=279' title='\u7a0b\u5e8f' target='_blank' rel=\"noopener\">\u7a0b\u5e8f<\/a>\u5f00\u53d1\u7684\u6280\u672f\u6587\u7ae0\uff0c\u4e5f\u4f1a\u5f55\u5236\u4e00\u4e9b\u6559\u5b66\u89c6\u9891\uff0c\u656c\u8bf7\u5927\u5bb6\u5173\u6ce8\u3002<\/p>\n<p>\u6211\u4eec\u4eca\u5929\u8981\u8ddf\u5927\u5bb6\u804a\u4e00\u804a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u7684<a href='https:\/\/www.gzlcy.cn\/?p=119' title='\u6a21\u5757' target='_blank' rel=\"noopener\">\u6a21\u5757<\/a>\u5316\u662f\u600e\u4e48\u5b9e\u73b0\u7684\u3002<\/p>\n<p>\u9996\u5148\u8bf4\u8bf4\u6a21\u5757\u5316\u8fd9\u4e2a\u6982\u5ff5\uff0c\u901a\u4fd7\u70b9\u8bb2\uff0c\u6240\u8c13\u7684\u6a21\u5757\u5316\u5c31\u662f\u628a\u4e00\u4e9b\u901a\u7528\u529f\u80fd\u5199\u6210\u4e00\u4e2a\u4e2a\u7684\u6a21\u5757\uff0c\u6211\u4eec\u5728\u4f7f\u7528\u65f6\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\u5df2\u7ecf\u5f00\u53d1\u597d\u7684\u6a21\u5757\uff0c\u8fd9\u6837\u505a\u7684\u597d\u5904\u662f\u53ef\u4ee5\u51cf\u5c11\u91cd\u590d\u7684\u4ee3\u7801\u5f00\u53d1\uff0c\u800c\u4e14\u4e5f\u4f7f\u5f97\u7a0b\u5e8f\u66f4\u52a0\u5bb9\u6613\u7ef4\u62a4\uff0c\u5982\u679c\u6a21\u5757\u8bbe\u8ba1\u7684\u597d\uff0c\u6211\u4eec\u7f16\u5199\u7a0b\u5e8f\u6210\u5c31\u5982\u4e0b\u56fe\uff0c\u50cf\u642d\u79ef\u6728\u4e00\u6837\u3002<\/p>\n<p><img src='http:\/\/mmbiz.qpic.cn\/mmbiz_png\/tnSlbuRyZ9Vb9NdibIkib2eFMrnu8ickgWtjp347rAgmrADAjIr6XsrVsNPfIoMsoWuL1Faibq0RadgITG2pFicdbNg\/0?wx_fmt=png' alt='\u5fae\u4fe1\u5c0f\u7a0b\u5e8fmd5.js_\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f15\u5165js_\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f15\u5165vue.js' \/><\/p>\n<p>js\u7684\u4e00\u4e2a\u6a21\u5757\u5bf9\u5e94\u7740\u4e00\u4e2ajs\u6587\u4ef6\uff0c\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d\u4e5f\u4e00\u6837\uff0c\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u6211\u4eec\u53ef\u4ee5\u5c06\u4e00\u4e9b\u516c\u5171\u7684\u4ee3\u7801\u62bd\u79bb\u6210\u4e3a\u4e00\u4e2a\u5355\u72ec\u7684 js \u6587\u4ef6\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u6a21\u5757\u3002\u6a21\u5757\u53ea\u6709\u901a\u8fc7module.exports\u6216\u8005exports\u624d\u80fd\u5bf9\u5916\u66b4\u9732\u63a5\u53e3\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a<\/p>\n<p>exports\u662fmodule.exports\u7684\u4e00\u4e2a\u5f15\u7528\uff0c\u6211\u4eec\u66f4\u63a8\u8350\u5f00\u53d1\u8005\u91c7\u7528module.exports\u6765\u66b4\u9732\u6a21\u5757\u63a5\u53e3(\u56e0\u4e3a\u5728\u6a21\u5757\u91cc\u8fb9\u968f\u610f\u66f4\u6539exports\u7684\u6307\u5411\u4f1a\u9020\u6210\u672a\u77e5\u7684\u9519\u8bef\u3002)\u3002<\/p>\n<p>\u5c0f\u7a0b\u5e8f\u76ee\u524d\u4e0d\u652f\u6301\u76f4\u63a5\u5f15\u5165node_modules, \u5f00\u53d1\u8005\u9700\u8981\u4f7f\u7528\u5230node_modules\u65f6\u5019\u5efa\u8bae\u62f7\u8d1d\u51fa\u76f8\u5173\u7684\u4ee3\u7801\u5230\u5c0f\u7a0b\u5e8f\u7684\u76ee\u5f55\u4e2d\u3002<\/p>\n<p>\u4f8b\uff1a\u6211\u4eec\u5b9a\u4e49\u5df2\u4e2acommon\u7684\u6a21\u5757\uff0c\u6587\u4ef6\u4e3acommon.js<\/p>\n<p><pre style=\", Menlo, Courier, monospace;font-size: 14px;direction: ltr;margin-top: 0px;margin-bottom: 1.275em;padding: 0.85em 1em;border: none;overflow: auto;letter-spacing: 0.2px;line-height: 23.8px\"><code class=\"lang-javascript\" style=\", Menlo, Courier, monospace;font-size: 0.85em;direction: ltr;border: none;color: inherit;max-width: initial;overflow: initial;line-height: inherit;background: 0px 0px\"><span class=\"hljs-comment\" style=\"font-size: inherit\">\/\/ common.js<br \/><\/span><span class=\"hljs-function\" style=\"font-size: inherit\"><span class=\"hljs-keyword\" style=\"font-size: inherit\">function<\/span> <span class=\"hljs-title\" style=\"font-size: inherit\">sayHello<\/span>(<span class=\"hljs-params\" style=\"font-size: inherit\">name<\/span>) <\/span>{<br \/> \u00a0<span class=\"hljs-built_in\" style=\"font-size: inherit\">console<\/span>.log(<span class=\"hljs-string\" style=\"font-size: inherit\">`Hello <span class=\"hljs-subst\" style=\"font-size: inherit\">${name}<\/span> !`<\/span>)\n}<br \/><span class=\"hljs-function\" style=\"font-size: inherit\"><span class=\"hljs-keyword\" style=\"font-size: inherit\">function<\/span> <span class=\"hljs-title\" style=\"font-size: inherit\">sayGoodbye<\/span>(<span class=\"hljs-params\" style=\"font-size: inherit\">name<\/span>) <\/span>{ <br \/> \u00a0\u00a0<span class=\"hljs-built_in\" style=\"font-size: inherit\">console<\/span>.log(<span class=\"hljs-string\" style=\"font-size: inherit\">`Goodbye <span class=\"hljs-subst\" style=\"font-size: inherit\">${name}<\/span> !`<\/span>)\n}<br \/><span class=\"hljs-built_in\" style=\"font-size: inherit\">module<\/span>.exports.sayHello = sayHello\nexports.sayGoodbye = sayGoodbye \/\/\u8fd9\u91cc\u4e5f\u53ef\u4ee5\u5199\u6210<\/code><code class=\"lang-javascript\" style=\"color: inherit;letter-spacing: 0.2px;line-height: inherit;, Menlo, Courier, monospace;font-size: 0.85em;direction: ltr;border: none;max-width: initial;overflow: initial;background: 0px 0px\"><span class=\"hljs-built_in\" style=\"font-size: inherit\">module<\/span>.<\/code><span style=\"color: inherit;letter-spacing: 0.2px;line-height: inherit;font-size: 0.85em;background-color: initial\">exports.sayGoodbye = sayGoodbye<br \/><\/span><\/pre>\n<\/p>\n<p>\u5728\u9700\u8981\u4f7f\u7528\u8fd9\u4e9b\u6a21\u5757\u7684\u6587\u4ef6\u4e2d\uff0c\u4f7f\u7528require(path)\u5c06\u516c\u5171\u4ee3\u7801\u5f15\u5165<\/p>\n<p><pre style=\", Menlo, Courier, monospace;font-size: 14px;direction: ltr;margin-top: 0px;padding: 0.85em 1em;border: none;overflow: auto;letter-spacing: 0.2px;line-height: 23.8px;margin-bottom: 0px !important\"><code class=\"lang-javascript\" style=\", Menlo, Courier, monospace;font-size: 0.85em;direction: ltr;border: none;color: inherit;max-width: initial;overflow: initial;line-height: inherit;background: 0px 0px\"><span class=\"hljs-keyword\" style=\"font-size: inherit\">var<\/span> common = <span class=\"hljs-built_in\" style=\"font-size: inherit\">require<\/span>(<span class=\"hljs-string\" style=\"font-size: inherit\">'common.js'<\/span>)\/\/\u8fd9\u91cc\u4f7f\u7528require\u65b9\u6cd5\u5f15\u5165common\u8fd9\u4e2a\u6a21\u5757\nPage({\n \u00a0helloMINA: <span class=\"hljs-function\" style=\"font-size: inherit\"><span class=\"hljs-keyword\" style=\"font-size: inherit\">function<\/span>(<span class=\"hljs-params\" style=\"font-size: inherit\"><\/span>) <\/span>{\n \u00a0 \u00a0common.sayHello(<span class=\"hljs-string\" style=\"font-size: inherit\">'MINA'<\/span>)\/\/\u8fd9\u91cc\u4f7f\u7528common\u4e2d\u7684sayHello\u65b9\u6cd5\n \u00a0},\n \u00a0goodbyeMINA: <span class=\"hljs-function\" style=\"font-size: inherit\"><span class=\"hljs-keyword\" style=\"font-size: inherit\">function<\/span>(<span class=\"hljs-params\" style=\"font-size: inherit\"><\/span>) <\/span>{\n \u00a0 \u00a0common.sayGoodbye(<span class=\"hljs-string\" style=\"font-size: inherit\">'MINA'<\/span>)<\/code><span style=\"color: inherit;font-size: 0.85em;line-height: inherit;letter-spacing: 0.2px;background-color: initial\">\/\/\u8fd9\u91cc\u4f7f\u7528common\u4e2d\u7684<\/span><span style=\"color: inherit;font-size: 0.85em;line-height: inherit;letter-spacing: 0.2px;background-color: initial\">sayGoodbye<\/span><span style=\"color: inherit;font-size: 0.85em;letter-spacing: 0.2px;line-height: inherit;background-color: initial\">\u65b9\u6cd5<\/span><\/pre>\n<\/p>\n<p><pre style=\", Menlo, Courier, monospace;font-size: 14px;direction: ltr;margin-top: 0px;padding: 0.85em 1em;border: none;overflow: auto;letter-spacing: 0.2px;line-height: 23.8px;margin-bottom: 0px !important\"><code class=\"lang-javascript\" style=\", Menlo, Courier, monospace;font-size: 0.85em;direction: ltr;border: none;color: inherit;max-width: initial;overflow: initial;line-height: inherit;background: 0px 0px\"> \u00a0}\n})<\/code><br \/><\/pre>\n<\/p>\n<p>\u5982\u679c\u8fd8\u6709\u5176\u4ed6\u5730\u65b9\u8981\u7528\u5230\u8fd9\u4e9b\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u4f7f\u7528\u540c\u6837\u7684\u65b9\u6cd5\u5f15\u5165\uff0c\u8fd9\u6837\u5c31\u8fbe\u5230\u4e86\u4e00\u6b21\u7f16\u7801\u591a\u5904\u4f7f\u7528\u7684\u76ee\u7684\uff0c\u4e5f\u4f7f\u5f97\u4ee3\u7801\u66f4\u52a0\u7684\u7b80\u6d01\u548c\u6e05\u723d\u3002<\/p>\n<p><img src='http:\/\/mmbiz.qpic.cn\/mmbiz_jpg\/tnSlbuRyZ9Vbrv5D7VnAibD1qZTibh6Dr1q0mWP7OIKmWoI1aPva2ViaUPorCkRIvLqOKkXrZet5guSIcibtSHv9TA\/640?wx_fmt=jpeg' alt='\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f15\u5165vue.js_\u5fae\u4fe1\u5c0f\u7a0b\u5e8fmd5.js_\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f15\u5165js' \/><\/p>\n<p>QQ\u7fa4\uff1a526013379<\/p>\n<p>\u793e\u533a\uff1a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u6211\u4eec\u53ef\u4ee5\u5c06\u4e00\u4e9b\u516c\u5171\u7684\u4ee3\u7801\u62bd\u79bb\u6210\u4e3a\u4e00\u4e2a\u5355\u72ec\u7684 js \u6587\u4ef6\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u6a21\u5757<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[856,855,854,89,542],"_links":{"self":[{"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=\/wp\/v2\/posts\/433"}],"collection":[{"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=433"}],"version-history":[{"count":0,"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=\/wp\/v2\/posts\/433\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=433"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gzlcy.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}