{"id":31598,"date":"2024-11-25T10:22:55","date_gmt":"2024-11-25T02:22:55","guid":{"rendered":"https:\/\/fwq.ai\/blog\/31598\/"},"modified":"2024-11-25T10:22:55","modified_gmt":"2024-11-25T02:22:55","slug":"phpcms%e8%83%bd%e7%94%a8vue%e5%bc%80%e5%8f%91%e5%90%97%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/31598\/","title":{"rendered":"PHPCMS\u80fd\u7528Vue\u5f00\u53d1\u5417\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/046\/5eedd5073e0d6418.jpg\" class=\"aligncenter\" title=\"PHPCMS\u80fd\u7528Vue\u5f00\u53d1\u5417\uff1f\u63d2\u56fe\" alt=\"PHPCMS\u80fd\u7528Vue\u5f00\u53d1\u5417\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>PHPCMS\u80fd\u7528Vue\u5f00\u53d1\u5417\uff1f<\/strong><\/p>\n<p>PHPCMS\u80fd\u7528Vue\u5f00\u53d1\uff0c\u53ea\u9700\u5728PHPCMS\u6a21\u677f\u4e2d\u5f15\u5165vue.js\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528Vue\u8fdb\u884c\u5f00\u53d1\uff0cVue\u662f\u4e00\u5957\u7528\u4e8e\u6784\u5efa\u7528\u6237\u754c\u9762\u7684\u6e10\u8fdb\u5f0fJavaScript\u6846\u67b6\uff0c\u8be5\u6846\u67b6\u76ee\u6807\u662f\u901a\u8fc7\u5c3d\u53ef\u80fd\u7b80\u5355\u7684API\u5b9e\u73b0\u54cd\u5e94\u7684\u6570\u636e\u7ed1\u5b9a\u548c\u7ec4\u5408\u7684\u89c6\u56fe\u7ec4\u4ef6\u3002<strong><br \/><\/strong><\/p>\n<p><strong>Vue \u7279\u70b9<\/strong><\/p>\n<p>\u6613\u7528<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>\u5728\u6709HTML CSS JavaScript\u7684\u57fa\u7840\u4e0a\uff0c\u5feb\u901f\u4e0a\u624b\u3002<\/p>\n<p>\u7075\u6d3b<\/p>\n<p>\u7b80\u5355\u5c0f\u5de7\u7684\u6838\u5fc3\uff0c\u6e10\u8fdb\u5f0f\u6280\u672f\u6808\uff0c\u8db3\u4ee5\u5e94\u4ed8\u4efb\u4f55\u89c4\u6a21\u7684\u5e94\u7528\u3002<\/p>\n<p>\u6027\u80fd<\/p>\n<p>20kb min+gzip \u8fd0\u884c\u5927\u5c0f\u3001\u8d85\u5feb\u865a\u62df&nbsp;DOM&nbsp;\u3001\u6700\u7701\u5fc3\u7684\u4f18\u5316\u3002<\/p>\n<p><strong>Vue \u76ee\u5f55\u7ed3\u6784<\/strong><\/p>\n<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u76ee\u5f55\/\u6587\u4ef6<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<tr>\n<td>build<\/td>\n<td>\u9879\u76ee\u6784\u5efa(webpack)\u76f8\u5173\u4ee3\u7801<\/td>\n<\/tr>\n<tr>\n<td>config<\/td>\n<td>\u914d\u7f6e\u76ee\u5f55\uff0c\u5305\u62ec\u7aef\u53e3\u53f7\u7b49\u3002\u6211\u4eec\u521d\u5b66\u53ef\u4ee5\u4f7f\u7528\u9ed8\u8ba4\u7684\u3002<\/td>\n<\/tr>\n<tr>\n<td>node_modules<\/td>\n<td>npm \u52a0\u8f7d\u7684\u9879\u76ee\u4f9d\u8d56\u6a21\u5757<\/td>\n<\/tr>\n<tr>\n<td>src<\/td>\n<td> \u5305\u542b\u4e86\u51e0\u4e2a\u76ee\u5f55\u53ca\u6587\u4ef6\uff1a <\/p>\n<ul>\n<li> assets: \u653e\u7f6e\u4e00\u4e9b\u56fe\u7247\uff0c\u5982logo\u7b49\u3002 <\/li>\n<li> components: \u76ee\u5f55\u91cc\u9762\u653e\u4e86\u4e00\u4e2a\u7ec4\u4ef6\u6587\u4ef6\uff0c\u53ef\u4ee5\u4e0d\u7528\u3002 <\/li>\n<li> App.vue: \u9879\u76ee\u5165\u53e3\u6587\u4ef6\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5c06\u7ec4\u4ef6\u5199\u8fd9\u91cc\uff0c\u800c\u4e0d\u4f7f\u7528 components \u76ee\u5f55\u3002 <\/li>\n<li> main.js: \u9879\u76ee\u7684\u6838\u5fc3\u6587\u4ef6\u3002 <\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>static<\/td>\n<td>\u9759\u6001\u8d44\u6e90\u76ee\u5f55\uff0c\u5982\u56fe\u7247\u3001\u5b57\u4f53\u7b49\u3002<\/td>\n<\/tr>\n<tr>\n<td>test<\/td>\n<td>\u521d\u59cb\u6d4b\u8bd5\u76ee\u5f55\uff0c\u53ef\u5220\u9664<\/td>\n<\/tr>\n<tr>\n<td>.xxxx\u6587\u4ef6<\/td>\n<td>\u8fd9\u4e9b\u662f\u4e00\u4e9b\u914d\u7f6e\u6587\u4ef6\uff0c\u5305\u62ec\u8bed\u6cd5\u914d\u7f6e\uff0cgit\u914d\u7f6e\u7b49\u3002<\/td>\n<\/tr>\n<tr>\n<td>index.html<\/td>\n<td>\u9996\u9875\u5165\u53e3\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e9b meta \u4fe1\u606f\u6216\u7edf\u8ba1\u4ee3\u7801\u5565\u7684\u3002<\/td>\n<\/tr>\n<tr>\n<td>package.json<\/td>\n<td>\u9879\u76ee\u914d\u7f6e\u6587\u4ef6\u3002<\/td>\n<\/tr>\n<tr>\n<td>README.md<\/td>\n<td>\u9879\u76ee\u7684\u8bf4\u660e\u6587\u6863\uff0cmarkdown \u683c\u5f0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u63a8\u8350\u6559\u7a0b\uff1a\u300a\/&#8221; target=&#8221;_blank&#8221;&gt;PHPCMS\u6559\u7a0b\u300b<\/p>\n<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fPHPCMS\u80fd\u7528Vue\u5f00\u53d1\u5417\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>PHPCMS\u80fd\u7528Vue\u5f00\u53d1\u5417\uff1f PHPCMS\u80fd\u7528Vue\u5f00\u53d1\uff0c\u53ea\u9700\u5728PHPCMS\u6a21\u677f\u4e2d\u5f15\u5165vue.js\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528Vue\u8fdb\u884c\u5f00\u53d1\uff0cVue\u662f\u4e00\u5957\u7528\u4e8e\u6784\u5efa\u7528\u6237\u754c\u9762\u7684\u6e10\u8fdb\u5f0fJavaScript\u6846\u67b6\uff0c\u8be5\u6846\u67b6\u76ee\u6807\u662f\u901a\u8fc7\u5c3d\u53ef\u80fd\u7b80\u5355\u7684API\u5b9e\u73b0\u54cd\u5e94\u7684\u6570\u636e\u7ed1\u5b9a\u548c\u7ec4\u5408\u7684\u89c6\u56fe\u7ec4\u4ef6\u3002 Vue \u7279\u70b9 \u6613\u7528 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u5728\u6709HTML CSS JavaScript\u7684\u57fa\u7840\u4e0a\uff0c\u5feb\u901f\u4e0a\u624b\u3002 \u7075\u6d3b \u7b80\u5355\u5c0f\u5de7\u7684\u6838\u5fc3\uff0c\u6e10\u8fdb\u5f0f\u6280\u672f\u6808\uff0c\u8db3\u4ee5\u5e94\u4ed8\u4efb\u4f55\u89c4\u6a21\u7684\u5e94\u7528\u3002 \u6027\u80fd 20kb min+gzip \u8fd0\u884c\u5927\u5c0f\u3001\u8d85\u5feb\u865a\u62df&nbsp;DOM&nbsp;\u3001\u6700\u7701\u5fc3\u7684\u4f18\u5316\u3002 Vue \u76ee\u5f55\u7ed3\u6784 \u76ee\u5f55\/\u6587\u4ef6 \u8bf4\u660e build \u9879\u76ee\u6784\u5efa(webpack)\u76f8\u5173\u4ee3\u7801 config \u914d\u7f6e\u76ee\u5f55\uff0c\u5305\u62ec\u7aef\u53e3\u53f7\u7b49\u3002\u6211\u4eec\u521d\u5b66\u53ef\u4ee5\u4f7f\u7528\u9ed8\u8ba4\u7684\u3002 node_modules npm \u52a0\u8f7d\u7684\u9879\u76ee\u4f9d\u8d56\u6a21\u5757 src \u5305\u542b\u4e86\u51e0\u4e2a\u76ee\u5f55\u53ca\u6587\u4ef6\uff1a assets: \u653e\u7f6e\u4e00\u4e9b\u56fe\u7247\uff0c\u5982logo\u7b49\u3002 components: \u76ee\u5f55\u91cc\u9762\u653e\u4e86\u4e00\u4e2a\u7ec4\u4ef6\u6587\u4ef6\uff0c\u53ef\u4ee5\u4e0d\u7528\u3002 App.vue: \u9879\u76ee\u5165\u53e3\u6587\u4ef6\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5c06\u7ec4\u4ef6\u5199\u8fd9\u91cc\uff0c\u800c\u4e0d\u4f7f\u7528 components \u76ee\u5f55\u3002 main.js: \u9879\u76ee\u7684\u6838\u5fc3\u6587\u4ef6\u3002 static \u9759\u6001\u8d44\u6e90\u76ee\u5f55\uff0c\u5982\u56fe\u7247\u3001\u5b57\u4f53\u7b49\u3002 test \u521d\u59cb\u6d4b\u8bd5\u76ee\u5f55\uff0c\u53ef\u5220\u9664 .xxxx\u6587\u4ef6 \u8fd9\u4e9b\u662f\u4e00\u4e9b\u914d\u7f6e\u6587\u4ef6\uff0c\u5305\u62ec\u8bed\u6cd5\u914d\u7f6e\uff0cgit\u914d\u7f6e\u7b49\u3002 index.html \u9996\u9875\u5165\u53e3\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e9b meta \u4fe1\u606f\u6216\u7edf\u8ba1\u4ee3\u7801\u5565\u7684\u3002 package.json \u9879\u76ee\u914d\u7f6e\u6587\u4ef6\u3002 README.md \u9879\u76ee\u7684\u8bf4\u660e\u6587\u6863\uff0cmarkdown \u683c\u5f0f \u63a8\u8350\u6559\u7a0b\uff1a\u300a\/&#8221; target=&#8221;_blank&#8221;&gt;PHPCMS\u6559\u7a0b\u300b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-31598","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31598","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=31598"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31598\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=31598"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=31598"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=31598"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}