{"id":101009,"date":"2020-05-21T05:01:01","date_gmt":"2020-05-20T21:01:01","guid":{"rendered":"http:\/\/4563.org\/?p=101009"},"modified":"2020-05-21T05:01:01","modified_gmt":"2020-05-20T21:01:01","slug":"vue-%e8%90%8c%e6%96%b0%e6%b1%82%e5%8a%a9%ef%bc%8c%e5%85%b3%e4%ba%8e-template-%e7%9a%84%e4%b8%80%e4%b8%aa%e5%b0%8f%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=101009","title":{"rendered":"vue \u840c\u65b0\u6c42\u52a9\uff0c\u5173\u4e8e template \u7684\u4e00\u4e2a\u5c0f\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  vue \u840c\u65b0\u6c42\u52a9\uff0c\u5173\u4e8e template \u7684\u4e00\u4e2a\u5c0f\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : asanelder <\/span>  <span><i><\/i> 1<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6709\u5982\u4e0b\u4e24\u4e2a\u6587\u4ef6<\/p>\n<h2>index.html<\/h2>\n<pre><code>&lt;html&gt;  &lt;head&gt;   &lt;title&gt;Vue Hello World&lt;\/title&gt;  &lt;\/head&gt;  &lt;body&gt;   &lt;div id=\"app\"&gt;&lt;\/div&gt;  &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<h2>main.js<\/h2>\n<pre><code>import Vue from 'vue';  new Vue({  el: '#app',  template: \"&lt;p&gt; test &lt;p&gt;\" }); <\/code><\/pre>\n<p>\u4f7f\u7528 webpack \u6253\u5305\u540e\uff0c\u5728\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884c\uff0c\u7ed3\u679c\u662f\u8fd9\u6837\u7684<\/p>\n<pre><code>&lt;html&gt;  &lt;head&gt;   &lt;title&gt;Vue Hello World&lt;\/title&gt;  &lt;\/head&gt;   &lt;body&gt;   &lt;div id=\"app\"&gt;&lt;\/div&gt;      &lt;script src=\"main.js\"&gt;&lt;\/script&gt;  &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>\u5e76\u6ca1\u6709\u66ff\u6362\u5230<\/p>\n<p>\uff0c\u4e0d\u660e\u767d\u554a\uff0c\u6c42\u5927\u795e\u6307\u70b9\uff01\uff01\uff01\uff01       <\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>13<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1669548\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : troycode <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u9875\u9762\u91cc\u9700\u5f15\u7528 &lt;template&gt;&lt;\/template&gt;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669549\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SilentDepth <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u7684\u4ee3\u7801\u770b\u8d77\u6765\u6ca1\u5565\u95ee\u9898\u3002\u63a7\u5236\u53f0\u91cc\u6ca1\u6709\u5f02\u5e38\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669550\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : asanelder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SilentDepth \u6ca1\u6709\u4efb\u4f55\u5f02\u5e38\uff0c\u901a\u8fc7\u6d4f\u89c8\u5668\u7684 devtools \u5de5\u5177\u6765\u67e5\u770b\u7684\u8bdd\uff0cdiv element \u6ca1\u6709\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669551\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : asanelder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @troycode \u5927\u795e\u8bf7\u660e\u793a\u554a\uff0c\u5728\u54ea\u91cc\u52a0\u5462\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669552\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SilentDepth <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u521a\u6ce8\u610f\u5230\u4f60\u7684 template \u5199\u9519\u4e86\uff0c&lt;p&gt; \u7684\u5173\u95ed\u6807\u7b7e = =                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669553\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : asanelder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669554\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SilentDepth <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SilentDepth \u611f\u8c22\u56de\u590d\u554a\uff0c\u6211\u627e\u5230\u539f\u56e0\u4e86\u3002<\/p>\n<p>\u4e3b\u8981\u662f webpack \u6700\u540e\u6253\u5305\u6210\u7684 bundle.js \u4e0d\u5305\u542b vue-compile, \u6240\u4ee5 template: &#8216;&lt;p&gt; test &lt;\/p&gt;&#8217; \u662f\u4e0d\u8d77\u4f5c\u7528\u7684\u3002<\/p>\n<p>\u8981\u60f3\u8d77\u4f5c\u7528\uff0c\u9700\u8981\u4f7f\u7528 SFC \u6216\u8005 render \u51fd\u6570\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669555\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : asanelder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u662f\u554a\uff0c\u6211\u8bd5\u4e86\u4e0b &lt;p&gt;test&lt;\/p&gt; \u662f\u53ef\u4ee5\u6b63\u5e38\u7f16\u8bd1\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669556\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SilentDepth <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SilentDepth \u4f60\u7684 webpack \u6587\u4ef6\uff1f \u4f60\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00 html,\u663e\u793a test \u4e48\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669557\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ghosthcp516 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u672c\u5730\u53c8\u8bd5\u4e86\u4e0b\uff0c\u786e\u5b9e\u662f\u4e0d\u884c\uff08\u521a\u624d\u5728 CodeSandbox \u4e0a\u8bd5\u7684\uff0c\u53ef\u4ee5\u6b63\u5e38\u7f16\u8bd1\uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669558\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ghosthcp516 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             vue.runtime.js \u6ca1\u6709 template \u7f16\u8bd1\u76f8\u5173\u7684\u4ee3\u7801\uff0c\u4e0d\u80fd\u76f4\u63a5\u5199 template\uff0cvue.js \u624d\u884c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669559\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : asanelder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ghosthcp516 \u5373\u4fbf\u4f7f\u7528\u4e86 vue-template-compiler\uff0c \u4e5f\u53ea\u80fd\u5728.vue \u6587\u4ef6\u4e2d\u5199 template\uff0c .js \u6587\u4ef6\u5c31\u7231\u83ab\u80fd\u52a9\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1669560\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : <a href=\"http:\/\/machbbs.com\/user-2.htm\"><\/a> <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ghosthcp516 \u5dee\u4e0d\u591a\u662f\u8fd9\u4e2a\u610f\u601d\uff0c\u770b\u6211 6 \u7684\u56de\u590d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>vue \u840c\u65b0\u6c42\u52a9\uff0c\u5173\u4e8e templ&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/101009"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=101009"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/101009\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=101009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=101009"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=101009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}