{"id":2106,"date":"2023-04-01T16:14:22","date_gmt":"2023-04-01T08:14:22","guid":{"rendered":"https:\/\/cocozq.com\/?p=2106"},"modified":"2023-04-01T17:18:29","modified_gmt":"2023-04-01T09:18:29","slug":"wordpress%e6%95%b4%e5%90%88%e9%9b%86%e6%88%90vue%e5%8d%87%e7%ba%a7%ef%bc%8c%e6%94%af%e6%8c%81%e6%ba%90%e7%a0%81%e5%8f%8a%e5%8d%95%e9%a1%b5%e5%b5%8c%e5%85%a5","status":"publish","type":"post","link":"https:\/\/cocozq.com\/?p=2106","title":{"rendered":"WordPress\u6574\u5408\u96c6\u6210VUE\u5347\u7ea7\uff0c\u652f\u6301\u6e90\u7801\u53ca\u5355\u9875\u5d4c\u5165"},"content":{"rendered":"<blockquote><p>\n  \u5927\u6982\u5728\u4e94\u516d\u5e74\u524d\uff0c\u6211\u63a5\u89e6vue\u8fd8\u6ca1\u591a\u4e45\u7684\u65f6\u5019\u5c31\u4e3a\u8fd9\u6837\u7684\u9700\u6c42\u5728WP\u4e0a\u8fdb\u884c\u8fc7\u5c1d\u8bd5\uff0c\u53ea\u662f\u5f53\u65f6\u7684\u65b9\u6848\u662f\u901a\u8fc7\u4e3b\u9898\u6a21\u677f\u5b9e\u73b0\u7684\u3002\n<\/p><\/blockquote>\n<h2>\u5b9e\u73b0\u6b65\u9aa4\u5982\u4e0b<\/h2>\n<ul>\n<li>\u9009\u4e2d\u4e00\u4e2a\u4e3b\u9898\u6a21\u677f\uff0c\u5728page-templates\u521b\u5efa\u4e00\u4e2avue\u7684php\u6a21\u677f<\/li>\n<li>\u521b\u5efa\u4e00\u4e2aheader\u5e76\u5f15\u5165css<\/li>\n<li>\u521b\u5efa\u4e00\u4e2afooter\u5f15\u5165vue.js<\/li>\n<li>\u7136\u540e\u5728wp\u540e\u53f0\u4ee5\u8fd9\u4e2a\u6a21\u677f\u521b\u5efa\u6587\u7ae0\uff0c\u5c06vue\u4ee3\u7801\u8d34\u5165\u5c31\u53ef\u4ee5\u4e86<\/li>\n<\/ul>\n<p>\u6a21\u677f\u5927\u81f4\u5982\u4e0b<\/p>\n<pre><code class=\"language-php line-numbers\">&lt;?php\n\/**\n * Template Name: Vue Template\n *\n * The template for the Vue page.\n *\n *\/\nget_vue_header(); ?&gt;\n&lt;div class=\"row\"&gt;\n    &lt;main id=\"main\" class=\"class of the theme\"&gt;\n\n        &lt;?php while ( have_posts() ) : the_post(); ?&gt;\n            &lt;?php get_vue_content(); ?&gt;\n        &lt;?php endwhile; \/\/ End of the loop. ?&gt;\n    &lt;\/main&gt;&lt;!-- #main --&gt;\n&lt;\/div&gt;\n&lt;?php get_sidebar(); ?&gt;\n&lt;?php get_vue_footer(); ?&gt;\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u65b9\u6848\u7684\u7f3a\u70b9\u5c31\u662f\u4e00\u5347\u7ea7\u4e3b\u9898\u5c31\u5f97\u6539\u4e00\u4e0b\uff0c\u5f88\u9ebb\u70e6\uff0c\u53bb\u627e\u8fc7\u51e0\u4e2a\u529f\u80fd\u7c7b\u4f3c\u529f\u80fd\u7684\u63d2\u4ef6\uff0c\u4ee3\u7801\u4e5f\u5927\u81f4\u770b\u8fc7\uff0c\u4f46\u662f\u90fd\u4e0d\u592a\u597d\u7528\uff0c\u540e\u6765\u6211\u81ea\u5df1\u4e5f\u5199\u4e86\u4e00\u4e2a\u63d2\u4ef6\uff0c\u505a\u5230\u4e00\u534a\u4e22\u90a3\u5c31\u6ca1\u7ba1\u4e86\uff0c\u4e3b\u8981\u662f\u6ca1\u6709\u4ec0\u4e48\u9700\u6c42\uff0c\u4f46\u662f\u6211\u6700\u8fd1\u60f3\u505a\u4e00\u4e9b\u7b80\u5355\u7684\u9875\u9762\u5d4c\u5165\uff0c\u4e8e\u662f\u53c8\u628a\u8fd9\u4e2a\u63d2\u4ef6\u638f\u51fa\u6765\u4fee\u6539\u4e00\u4e0b\uff0c\u4e3b\u8981\u5c31\u662f\u7528WordPress\u7684Shortcode\u8fdb\u884c\u6269\u5c55\uff0c\u987a\u4fbf\u628a\u4e24\u4e2a\u56db\u4e94\u5e74\u524d\u7ec3\u4e60vue\u7684demo\u96c6\u6210\u4e86\u8fdb\u53bb\uff0c\u611f\u89c9\u8fd8\u4e0d\u9519\u3002<\/p>\n<h2>\u4e3b\u8981\u5b9e\u73b0\u7684\u529f\u80fd<\/h2>\n<ul>\n<li>vue\u5e93\u5f15\u5165\uff0c\u53ef\u4ee5\u901a\u8fc7\u5c5e\u6027\u914d\u7f6e\u662f\u5426\u52a0\u8f7d\u3002<\/li>\n<li>\u52a8\u6001\u52a0\u8f7d<code>js\/css<\/code>\u6587\u4ef6\uff0c\u652f\u6301\u672c\u5730\u53ca\u7f51\u7edc\u52a0\u8f7d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5c5e\u6027\u53caapp\u914d\u7f6e\u8fdb\u884c\u63a7\u5236\u3002<\/li>\n<li>\u76ee\u524d\u96c6\u6210\u4e86<code>element-ui\/balm-ui\/vant<\/code>\u6846\u67b6\uff0c\u53ef\u4ee5\u901a\u8fc7\u5c5e\u6027\u914d\u7f6e\u52a8\u6001\u88c5\u8f7d\u6307\u5b9a\u7248\u672c\u3002<\/li>\n<li>\u6e90\u7801\u578b\u9875\u9762\u5d4c\u5165\uff0c\u8fd9\u79cd\u652f\u6301\u5728\u7ebf\u76f4\u63a5\u8fb9\u5f00\u53d1\u53d8\u9884\u89c8\uff0c\u9002\u7528\u4e8e\u5c0f\u529f\u80fd\u9700\u6c42\uff0c\u6bd4\u8f83\u4fbf\u6377\u3002<\/li>\n<li>\u53d1\u5e03\u578b\u4ee3\u7801\u5d4c\u5165\uff0c\u652f\u6301\u9879\u76ee\u751f\u6210\u73af\u5883\u6253\u5305\u4e4b\u540e\uff0c\u914d\u7f6e\u4e00\u4e2a<code>app.json<\/code>\u6587\u4ef6\uff0c\u5373\u53ef\u88c5\u8f7d\uff0c\u672c\u5730\u5f00\u53d1\u8fdc\u7a0b\u53d1\u5e03\u3002<\/li>\n<li>\u9879\u76ee\u578b\u4ee3\u7801\u5d4c\u5165\uff0c\u8fd9\u4e2a\u662f\u4e0a\u9762\u4e24\u79cd\u65b9\u5f0f\u7684\u6574\u5408\uff0c\u901a\u8fc7<code>webpack<\/code>\u4e00\u7c7b\u7ba1\u7406\uff0c\u53ef\u4ee5\u8fdc\u7a0b\u5f00\u53d1\u673a\u53d1\u5e03\u3002<\/li>\n<\/ul>\n<h2>\u5f15\u5165\u65b9\u5f0f\u5927\u81f4\u5982\u4e0b<\/h2>\n<pre><code class=\"language-bash line-numbers\">coco_vue app=\"fb_demo\" \/\/app\u540d\u79f0\nvue=\"true\" \/\/ \u542f\u7528vue\ndebug=\"true\" \/\/\u662f\u5426\u5f00\u542f\u8c03\u8bd5\njs=\"manifest|https:\/\/cocozq.com\/js\/test.js\" \/\/\u672c\u5730\u53ca\u7f51\u7edcjs\u52a0\u8f7d\nui=\"element-ui|1.8.8\" \/\/ \u4f7f\u7528ui\u6846\u67b6\u53ca\u7248\u672c\ncss=\"https:\/\/cocozq.com\/css\/test.css|style\" \/\/\u672c\u5730\u53ca\u7f51\u7edccss\u52a0\u8f7d\n<\/code><\/pre>\n<p>\u5982\u679c\u662f\u53d1\u5e03\u578b\u5d4c\u5165\uff0c\u8ddf\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e00\u6837\uff0c\u76f4\u63a5\u901a\u8fc7\u77ed\u4ee3\u7801\u6307\u5b9aapp\u540d\u79f0\u5373\u53ef\u3002<\/p>\n<h3>\u6f14\u793ademo<\/h3>\n<p>\u4e0b\u9762\u4e24\u4e2a<code>demo<\/code>\u90fd\u662f\u6211\u4e94\u516d\u5e74\u524d\u7ec3\u4e60<code>vue<\/code>\u5199\u7684<\/p>\n<h6>1. \u6e90\u7801\u578bdemo<\/h6>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/cocozq.com\/?page_id=2088\"><strong>\u8db3\u5f69\u5956\u91d1\u5728\u7ebf\u8ba1\u7b97<\/strong><\/a><\/p>\n<h6>2. \u53d1\u5e03\u578b\u5d4c\u5165demo<\/h6>\n<p>\u539f\u672c\u662f\u653e\u5728\u5b89\u5353App\u91cc\u9762\u7684\u4e00\u4e2a\u5355\u72ec\u9875\u9762\uff0c\u901a\u8fc7webview\u8fdb\u884c\u52a0\u8f7d\u7684\uff0c\u73b0\u5728\u53ea\u7ecf\u8fc7\u7b80\u5355\u4fee\u6539\uff0c\u53ef\u4ee5\u76f4\u63a5\u5d4c\u5165<\/p>\n<div id=\"coco_vue_1\" class=\"coco_vue coco_vue_app_fb_demo\"><div>\n    <div id=app>\n    <\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u6982\u5728\u4e94\u516d\u5e74\u524d\uff0c\u6211\u63a5\u89e6vue\u8fd8\u6ca1\u591a\u4e45\u7684\u65f6\u5019\u5c31\u4e3a\u8fd9\u6837\u7684\u9700\u6c42\u5728WP\u4e0a\u8fdb\u884c\u8fc7\u5c1d\u8bd5\uff0c\u53ea\u662f\u5f53\u65f6\u7684\u65b9\u6848\u662f\u901a\u8fc7\u4e3b\u9898\u6a21\u677f\u5b9e\u73b0\u7684 &hellip; <a href=\"https:\/\/cocozq.com\/?p=2106\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;WordPress\u6574\u5408\u96c6\u6210VUE\u5347\u7ea7\uff0c\u652f\u6301\u6e90\u7801\u53ca\u5355\u9875\u5d4c\u5165&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[127,126],"class_list":["post-2106","post","type-post","status-publish","format-standard","hentry","category-22","tag-vue","tag-126","hfeed"],"_links":{"self":[{"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/posts\/2106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cocozq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2106"}],"version-history":[{"count":30,"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/posts\/2106\/revisions"}],"predecessor-version":[{"id":2136,"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/posts\/2106\/revisions\/2136"}],"wp:attachment":[{"href":"https:\/\/cocozq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cocozq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cocozq.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}