{"id":307980,"date":"2020-08-04T15:01:21","date_gmt":"2020-08-04T15:01:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=307980"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=307980","title":{"rendered":"\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432\u043e vuejs"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/513728\/\">\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443, \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 (\u043e\u043d \u0436\u0435, \u043e\u0431\u044b\u0447\u043d\u043e, App.vue) \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e &lt;router-view&gt; \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u044c\u044e\u0448\u043a\u0438.  <\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/me\/wu\/y_\/mewuy_9yzvmwsxossjsv6rdoabs.gif\" alt=\"image\" \/><\/div>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043e\u0431\u0449\u0430\u044f \u0448\u0430\u043f\u043a\u0430. \u0421\u0430\u0439\u0442.<\/p>\n<p>\u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f? \u042d\u0442\u0438\u043c \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f.  <\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e Vue Js \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c.  <\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u044b? \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0431\u0443\u0434\u044c \u0442\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u0438\u0446\u0430, \u0441\u0442\u0430\u0442\u0443\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 (\u043f\u043e \u0431\u0440\u0435\u0434\u0443) \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0442\u043e\u043a.  <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u0447\u0435\u0440\u0435\u0437 Vue-Cli \u0443 \u0432\u0430\u0441 \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:  <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/App.vue  &lt;template&gt;   &lt;div id=&quot;app&quot;&gt;     &lt;div id=&quot;nav&quot;&gt;       &lt;router-link to=&quot;\/&quot;&gt;Home&lt;\/router-link&gt; |       &lt;router-link to=&quot;\/about&quot;&gt;About&lt;\/router-link&gt;     &lt;\/div&gt;     &lt;router-view\/&gt;   &lt;\/div&gt; &lt;\/template&gt;  &lt;style&gt; #app {   font-family: Avenir, Helvetica, Arial, sans-serif;   -webkit-font-smoothing: antialiased;   -moz-osx-font-smoothing: grayscale;   text-align: center;   color: #2c3e50; }  #nav {   padding: 30px; }  #nav a {   font-weight: bold;   color: #2c3e50; }  #nav a.router-link-exact-active {   color: #42b983; } &lt;\/style&gt; <\/code><\/pre>\n<p>\u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e (Computed) \u0432 \u0441\u0435\u043a\u0446\u0438\u044e \u00abscript\u00bb (\u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0435 \u043d\u0435\u0442, \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0435 \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e vue \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430).<\/p>\n<p>\u042d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0430\u043c \u0438\u043c\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430-\u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u2014 \u0448\u0430\u0431\u043b\u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.  <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/App.vue ...  &lt;script&gt;     export default {         computed: {             \/\/\u042d\u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e             layout(){                 \/\/\u0412\u0435\u0440\u043d\u0435\u043c \u0438\u043c\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0438\u0437 \u0440\u043e\u0443\u0442\u0430 \u0438\u043b\u0438 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435                    \/\/(\u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0448\u0430\u0431\u043b\u043e\u043d)                 return this.$route.meta.layout || &quot;default-layout&quot;              }         }     } &lt;\/script&gt;  ... <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u043a\u0446\u0438\u044e \u00abtemplate\u00bb \u2014 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f layout.  <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/App.vue  &lt;template&gt;   &lt;div id=&quot;app&quot;&gt;       &lt;!--\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442--&gt;       &lt;component :is=&quot;layout&quot;&gt;           &lt;router-view\/&gt;       &lt;\/component&gt;   &lt;\/div&gt; &lt;\/template&gt;  ... <\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u0440\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0445 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u00ablayouts\u00bb.  <\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eo\/7n\/a4\/eo7na4gfx6x29ibmynj_aoa_nfe.jpeg\" alt=\"\u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0430\u043f\u043a\u043e\u043a\" \/><\/div>\n<p>  <i>\u041f\u043e \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0448\u043b\u0430 \u043e\u0442 components \u0438\u043b\u0438 view, \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e.<\/i><\/p>\n<p>\u0415\u0441\u0442\u044c \u0443 Vue \u0442\u0430\u043a\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2014 \u00abslot\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442-\u0448\u0430\u0431\u043b\u043e\u043d. \u041f\u0440\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u043e\u043d \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0443\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0440\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u043f\u0443\u0441\u0442\u044c \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438, \u0441 \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439 \u0432 \u0446\u0432\u0435\u0442\u0435 \u0448\u0430\u043f\u043a\u0438 \u0438 \u043f\u043e\u0434\u0432\u0430\u043b\u0430, \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u0421\u0438\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d, \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439:  <\/p>\n<pre><code class=\"javascript\">\/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/layouts\/Default.vue  &lt;template&gt;     &lt;div&gt;         &lt;header&gt;             &lt;ul class=&quot;nav&quot;&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/&quot;&gt;\u0414\u043e\u043c\u0430\u0448\u043d\u044f\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430&lt;\/router-link&gt;&lt;\/li&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/page2&quot;&gt;\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 1&lt;\/router-link&gt;&lt;\/li&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/page3&quot;&gt;\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 2&lt;\/router-link&gt;&lt;\/li&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/page4&quot;&gt;\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 2&lt;\/router-link&gt;&lt;\/li&gt;             &lt;\/ul&gt;         &lt;\/header&gt;         &lt;section class=&quot;content&quot;&gt;              &lt;!--\u042d\u043b\u0435\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0432\u0430\u0448 view--&gt;             &lt;slot\/&gt;          &lt;\/section&gt;         &lt;footer&gt;          &lt;\/footer&gt;     &lt;\/div&gt; &lt;\/template&gt;  &lt;script&gt;     export default {         name: &quot;Default&quot;     } &lt;\/script&gt;  &lt;style scoped&gt;     header{         background-color: blue;         height: 70px;         display: flex;         align-items: center;     }      footer{         background-color: blue;         height: 70px;     }      .content{         min-height: calc(100vh - 140px);     }      ul{         list-style: none;         margin: 0;         color: white;     }      li{         color: white;         display: inline;         margin: 0 5px;     }      .link{         color: white;         text-decoration: none;     }  &lt;\/style&gt; <\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0435\u043b\u0435\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d:  <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/layouts\/Green.vue  &lt;template&gt;     &lt;div&gt;         &lt;header&gt;             &lt;ul class=&quot;nav&quot;&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/&quot;&gt;\u0414\u043e\u043c\u0430\u0448\u043d\u044f\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430&lt;\/router-link&gt;&lt;\/li&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/page2&quot;&gt;\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 1&lt;\/router-link&gt;&lt;\/li&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/page3&quot;&gt;\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 2&lt;\/router-link&gt;&lt;\/li&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/page4&quot;&gt;\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 2&lt;\/router-link&gt;&lt;\/li&gt;             &lt;\/ul&gt;         &lt;\/header&gt;         &lt;section class=&quot;content&quot;&gt;              &lt;!--\u042d\u043b\u0435\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0432\u0430\u0448 view--&gt;             &lt;slot\/&gt;          &lt;\/section&gt;         &lt;footer&gt;          &lt;\/footer&gt;     &lt;\/div&gt; &lt;\/template&gt;  &lt;script&gt;     export default {         name: &quot;green&quot;     } &lt;\/script&gt;  &lt;style scoped&gt;     header{         background-color: green;         height: 70px;         display: flex;         align-items: center;     }      footer{         background-color: green;         height: 70px;     }      .content{         min-height: calc(100vh - 140px);     }      ul{         list-style: none;         margin: 0;         color: white;     }      li{         color: white;         display: inline;         margin: 0 5px;     }      .link{         color: white;         text-decoration: none;     }  &lt;\/style&gt; <\/code><\/pre>\n<p>  \u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d:<\/p>\n<pre><code class=\"javascript\">\/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/layouts\/Red.vue  &lt;template&gt;     &lt;div&gt;         &lt;header&gt;             &lt;ul class=&quot;nav&quot;&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/&quot;&gt;\u0414\u043e\u043c\u0430\u0448\u043d\u044f\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430&lt;\/router-link&gt;&lt;\/li&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/page2&quot;&gt;\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 1&lt;\/router-link&gt;&lt;\/li&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/page3&quot;&gt;\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 2&lt;\/router-link&gt;&lt;\/li&gt;                 &lt;li&gt;&lt;router-link class=&quot;link&quot; to=&quot;\/page4&quot;&gt;\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 2&lt;\/router-link&gt;&lt;\/li&gt;             &lt;\/ul&gt;         &lt;\/header&gt;         &lt;section class=&quot;content&quot;&gt;              &lt;!--\u042d\u043b\u0435\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430 \u0432\u0430\u0448 view--&gt;             &lt;slot\/&gt;          &lt;\/section&gt;         &lt;footer&gt;          &lt;\/footer&gt;     &lt;\/div&gt; &lt;\/template&gt;  &lt;script&gt;     export default {         name: &quot;Red&quot;     } &lt;\/script&gt;  &lt;style scoped&gt;     header{         background-color: red;         height: 70px;         display: flex;         align-items: center;     }      footer{         background-color: red;         height: 70px;     }      .content{         min-height: calc(100vh - 140px);     }      ul{         list-style: none;         margin: 0;         color: white;     }      li{         color: white;         display: inline;         margin: 0 5px;     }      .link{         color: white;         text-decoration: none;     }  &lt;\/style&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b-\u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0432 \u043d\u0430\u0448\u0435\u043c Vue.<\/p>\n<pre><code class=\"javascript\">\/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/main.js  import Vue from 'vue' import App from '.\/App.vue' import router from '.\/router' \/\/\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 import DefaultLayout from &quot;.\/layouts\/Default&quot; import GreenLayout from &quot;.\/layouts\/Green&quot; import RedLayout from &quot;.\/layouts\/Red&quot;  \/\/\u0418 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Vue.component(&quot;default-layout&quot;, DefaultLayout) Vue.component(&quot;green-layout&quot;, GreenLayout) Vue.component(&quot;red-layout&quot;, RedLayout)  Vue.config.productionTip = false  new Vue({   router,   render: h =&gt; h(App) }).$mount('#app') <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0428\u0430\u0431\u043b\u043e\u043d\u044b \u0433\u043e\u0442\u043e\u0432\u044b, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f(\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b), \u0434\u0432\u0430 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0441\u0438\u043d\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c, \u0430 \u0434\u0432\u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0438 \u0437\u0435\u043b\u0435\u043d\u044b\u043c. \u041e\u043d\u0438 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u043c\u0438.  <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/views\/page1.vue  &lt;template&gt;     &lt;div&gt;         &lt;h1&gt;\u0421\u0438\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d&lt;\/h1&gt;     &lt;\/div&gt; &lt;\/template&gt;  &lt;script&gt;     export default {         name: &quot;Page1&quot;     } &lt;\/script&gt;  &lt;style scoped&gt; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">&lt;\/style&gt; \/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/views\/page2.vue  &lt;template&gt;     &lt;div&gt;         &lt;h1&gt;\u0417\u0435\u043b\u0435\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d&lt;\/h1&gt;     &lt;\/div&gt; &lt;\/template&gt;  &lt;script&gt;     export default {         name: &quot;Page2&quot;     } &lt;\/script&gt;  &lt;style scoped&gt;  &lt;\/style&gt; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/views\/page3.vue  &lt;template&gt;     &lt;div&gt;         &lt;h1&gt;\u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d&lt;\/h1&gt;     &lt;\/div&gt; &lt;\/template&gt;  &lt;script&gt;     export default {         name: &quot;Page3&quot;     } &lt;\/script&gt;  &lt;style scoped&gt;  &lt;\/style&gt;  <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/\u0412\u0410\u0428_\u041f\u0420\u041e\u0415\u041a\u0422\/src\/views\/page4.vue  &lt;template&gt;     &lt;div&gt;         &lt;h1&gt;\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u0438\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d&lt;\/h1&gt;     &lt;\/div&gt; &lt;\/template&gt;  &lt;script&gt;     export default {         name: &quot;Page4&quot;     } &lt;\/script&gt;  &lt;style scoped&gt;  &lt;\/style&gt; <\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u043e\u0443\u0442\u044b \u043f\u043e\u0434 \u043d\u0430\u0448\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0438 \u0432 \u043c\u0435\u0442\u0430-\u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u043a\u0430\u0436\u0435\u043c \u043a\u0430\u043a\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435.  <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import Vue from 'vue' import VueRouter from 'vue-router' \/\/\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043d\u0430\u0448\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b import Page1 from &quot;..\/views\/Page1&quot; import Page2 from &quot;..\/views\/Page2&quot; import Page3 from &quot;..\/views\/Page3&quot; import Page4 from &quot;..\/views\/Page4&quot;  Vue.use(VueRouter)  const routes = [     {         path: '\/',         name: 'Home',         component: Page1         \/\/\u0422\u0430\u043a, \u043a\u0430\u043a \u0441\u0438\u043d\u0438\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0443 \u043d\u0430\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043c\u0435\u0442\u0430-\u0434\u0430\u043d\u043d\u044b\u0445     },     {         path: '\/page2',         name: 'Page2',         component: Page2,         \/\/\u0410 \u0432\u043e\u0442 \u044d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430-\u0448\u0430\u0431\u043b\u043e\u043d\u0430,         \/\/\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b         meta:{             layout: &quot;green-layout&quot;         }     },     {         path: '\/page3',         name: 'Page3',         component: Page3,         meta:{             layout: &quot;red-layout&quot;         }     },     {         path: '\/page4',         name: 'Page4',         component: Page4,         \/\/\u0418 \u0441\u043d\u043e\u0432\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d     } ]  const router = new VueRouter({     mode: 'history',     base: process.env.BASE_URL,     routes })  export default router <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r7\/la\/a7\/r7laa7rnyckiafwtsd8fgpnz3ia.gif\" alt=\"image\"\/><\/p>\n<p>  <a href=\"https:\/\/drive.google.com\/open?id=1Cw-_EZq73sDnmPtR1WCfjT-F1usNn45o\">\u0426\u0435\u043b\u0438\u043a\u043e\u043c \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0443\u0442<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/513728\/\"> https:\/\/habr.com\/ru\/post\/513728\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/513728\/\">\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443, \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 (\u043e\u043d \u0436\u0435, \u043e\u0431\u044b\u0447\u043d\u043e, App.vue) \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e &lt;router-view&gt; \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u044c\u044e\u0448\u043a\u0438.  <\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/me\/wu\/y_\/mewuy_9yzvmwsxossjsv6rdoabs.gif\" alt=\"image\" \/><\/div>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043e\u0431\u0449\u0430\u044f \u0448\u0430\u043f\u043a\u0430. \u0421\u0430\u0439\u0442.<\/p>\n<p>\u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f? \u042d\u0442\u0438\u043c \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-307980","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307980","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=307980"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307980\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=307980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=307980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=307980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}