{"id":306980,"date":"2020-07-15T15:01:00","date_gmt":"2020-07-15T15:01:00","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306980"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306980","title":{"rendered":"Vue.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0443\u0440\u043e\u043a 4: \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0441\u043f\u0438\u0441\u043a\u043e\u0432"},"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\/company\/ruvds\/blog\/510898\/\">\u0421\u0435\u0433\u043e\u0434\u043d\u044f, \u0432 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u0443\u0447\u0435\u0431\u043d\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u0430 \u043f\u043e Vue, \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441\u043f\u0438\u0441\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/510898\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uy\/q3\/gm\/uyq3gma9wtrfx0egg8ct5direys.jpeg\"><\/a><\/p>\n<p>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/509700\/\">Vue.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0443\u0440\u043e\u043a 1: \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Vue<\/a><br \/>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/509702\/\">Vue.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0443\u0440\u043e\u043a 2: \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/a><br \/>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/510628\/\">Vue.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0443\u0440\u043e\u043a 3: \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433<\/a><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2><font color=\"#3AC1EF\">\u0426\u0435\u043b\u044c \u0443\u0440\u043e\u043a\u0430<\/font><\/h2>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0435 \u0442\u043e\u0432\u0430\u0440\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u043d\u0451\u043c. \u042d\u0442\u0438 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>80% cotton<\/li>\n<li>20% polyester<\/li>\n<li>Gender-neutral<\/li>\n<\/ul>\n<p>  <\/p>\n<h2><font color=\"#3AC1EF\">\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430<\/font><\/h2>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0442\u0430\u043a\u043e\u0433\u043e HTML-\u043a\u043e\u0434\u0430 (\u0444\u0430\u0439\u043b <code>index.html<\/code>):<\/p>\n<pre><code class=\"html\">&lt;div class=&quot;product&quot;&gt; \u00a0\u00a0&lt;div class=&quot;product-image&quot;&gt; \u00a0\u00a0\u00a0\u00a0&lt;img :src=&quot;image&quot; \/&gt; \u00a0\u00a0&lt;\/div&gt;  \u00a0\u00a0&lt;div class=&quot;product-info&quot;&gt; \u00a0\u00a0\u00a0\u00a0&lt;h1&gt;{{ product }}&lt;\/h1&gt; \u00a0\u00a0\u00a0\u00a0&lt;p v-if=&quot;inStock&quot;&gt;In stock&lt;\/p&gt; \u00a0\u00a0\u00a0\u00a0&lt;p v-else&gt;Out of Stock&lt;\/p&gt; \u00a0\u00a0&lt;\/div&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 <code>data<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 Vue \u0432 <code>main.js<\/code>:<\/p>\n<pre><code class=\"javascript\">data: { \u00a0\u00a0\u00a0\u00a0product: &quot;Socks&quot;, \u00a0\u00a0\u00a0\u00a0image: &quot;.\/assets\/vmSocks-green.jpg&quot;, \u00a0\u00a0\u00a0\u00a0inStock: true, \u00a0\u00a0\u00a0\u00a0details: ['80% cotton', '20% polyester', 'Gender-neutral'] } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u043e\u0432\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u2014 \u043c\u0430\u0441\u0441\u0438\u0432 <code>details<\/code>.<\/p>\n<h2><font color=\"#3AC1EF\">\u0417\u0430\u0434\u0430\u0447\u0430<\/font><\/h2>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <code>details<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432, \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<pre><code class=\"javascript\">details: ['80% cotton', '20% polyester', 'Gender-neutral'] <\/code><\/pre>\n<p>  <\/p>\n<h2><font color=\"#3AC1EF\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/font><\/h2>\n<p>  \u0422\u0443\u0442 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 Vue \u2014 <code>v-for<\/code>. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435\u0441\u044f \u0432 \u043d\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 <code>index.html<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"html\">&lt;ul&gt; \u00a0\u00a0&lt;li v-for=&quot;detail in details&quot;&gt;{{ detail }}&lt;\/li&gt; &lt;\/ul&gt; <\/code><\/pre>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u043e \u0442\u043e\u0432\u0430\u0440\u0435.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/b51\/a20\/48b\/b51a2048b50d37c9e4330b1a1a163530.png\"><\/div>\n<p>  <i><font color=\"#999999\">\u0421\u043f\u0438\u0441\u043e\u043a \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<\/font><\/i><\/p>\n<p>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u0445 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439 <code>v-for<\/code>, \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439 \u0442\u0435\u043c, \u043a\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f JavaScript-\u0446\u0438\u043a\u043b\u0430\u043c\u0438 <code>for of<\/code> \u0438\u043b\u0438 <code>for in<\/code>. \u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>v-for<\/code>.<\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0447\u0438\u0441\u043b\u0435 (<code>detail<\/code>) \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c\u0430 \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c\u044b\u0445 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u0438\u0448\u0435\u043c <code>in<\/code> \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u043c\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c (<code>details<\/code>). \u0412 \u0434\u0432\u043e\u0439\u043d\u044b\u0445 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e, \u043a\u0430\u043a\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c (<code>{{ detail }}<\/code>).<\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <code>v-for<\/code> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>&lt;li&gt;<\/code>, Vue \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>&lt;li&gt;<\/code> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <code>details<\/code>. \u0415\u0441\u043b\u0438 \u0431\u044b \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>v-for<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>&lt;div&gt;<\/code>, \u0442\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u0431\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>&lt;div&gt;<\/code>, \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<p>  \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>v-for<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0442\u043e\u0440. \u041e\u043d \u0431\u0435\u0440\u0451\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u0430 \u0440\u0430\u0437, \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/firebasestorage.googleapis.com\/v0\/b\/vue-mastery.appspot.com\/o\/flamelink%2Fmedia%2F1578365355028_6.gif?alt=media&amp;token=db3e6913-e5fa-4c46-8982-981ea62f6493\" alt=\"image\"><br \/>  <i><font color=\"#999999\">\u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 v-for \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440<\/font><\/i><\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f <code>v-for<\/code>, \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 <code>&lt;div&gt;<\/code> \u0434\u0430\u043d\u043d\u044b\u0435, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<h2><font color=\"#3AC1EF\">\u041f\u0435\u0440\u0435\u0431\u043e\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/font><\/h2>\n<p>  \u041a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 \u0442\u043e\u0432\u0430\u0440\u0430, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u0441\u044f, \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0442\u043e\u0432\u0430\u0440\u0430. \u042d\u0442\u0438 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 <code>variants<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 <code>data<\/code>. \u041a\u0430\u043a \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445?<\/p>\n<p>  \u0412\u043e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0434\u0451\u0442 \u0440\u0435\u0447\u044c:<\/p>\n<pre><code class=\"javascript\">variants: [ \u00a0\u00a0{ \u00a0\u00a0\u00a0\u00a0variantId: 2234, \u00a0\u00a0\u00a0\u00a0variantColor: 'green'\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0}, \u00a0\u00a0{ \u00a0\u00a0\u00a0\u00a0variantId: 2235, \u00a0\u00a0\u00a0\u00a0variantColor: 'blue' \u00a0\u00a0} ] <\/code><\/pre>\n<p>  \u0412 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u0430 \u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0442\u043e\u0432\u0430\u0440\u0430.<\/p>\n<p>  \u0412\u044b\u0432\u0435\u0434\u0435\u043c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435:<\/p>\n<pre><code class=\"html\">&lt;div v-for=&quot;variant in variants&quot;&gt; \u00a0\u00a0&lt;p&gt;{{ variant.variantColor }}&lt;\/p&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/a28\/b7d\/e5c\/a28b7de5c838e0552f7cf33d9e2f9551.png\"><\/div>\n<p>  <i><font color=\"#999999\">\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0442\u043e\u0432\u0430\u0440\u0430<\/font><\/i><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043b\u0438\u0448\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0440\u0430\u0437\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c \u0442\u043e\u0432\u0430\u0440\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b, \u043e\u0431\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u043e\u0447\u0435\u0447\u043d\u0443\u044e \u043d\u043e\u0442\u0430\u0446\u0438\u044e. \u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u044b, \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445, \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 <code>{{ variant }}<\/code>, \u0442\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u044b\u0432\u0435\u043b\u0441\u044f \u0431\u044b \u0432\u0435\u0441\u044c \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>key<\/code>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 Vue \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0432 \u043d\u0430\u0448 \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>variantId<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u0442\u043e\u0432\u0430\u0440\u0430:<\/p>\n<pre><code class=\"html\">&lt;div v-for=&quot;variant in variants&quot; :key=&quot;variant.variantId&quot;&gt; \u00a0\u00a0&lt;p&gt;{{ variant.variantColor }}&lt;\/p&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  <\/p>\n<h2><font color=\"#3AC1EF\">\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0443\u043c<\/font><\/h2>\n<p>  \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 <code>sizes<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u0445 \u043d\u043e\u0441\u043a\u043e\u0432, \u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>v-for<\/code>, \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>  \u041c\u0430\u0441\u0441\u0438\u0432 <code>sizes<\/code> \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">sizes: ['S', 'M', 'L', 'XL', 'XXL', 'XXXL'] <\/code><\/pre>\n<p>  <a href=\"https:\/\/codepen.io\/GreggPollack\/pen\/QYeNaq\">\u0412\u043e\u0442<\/a> \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>  \u2192 <a href=\"https:\/\/codepen.io\/GreggPollack\/pen\/ErqKoG\">\u0412\u043e\u0442<\/a> \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/p>\n<h2><font color=\"#3AC1EF\">\u0418\u0442\u043e\u0433\u0438<\/font><\/h2>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>v-for<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445\u0441\u044f \u0432 \u043d\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<li>\u0412 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>v-for<\/code> \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0441\u0435\u0432\u0434\u043e\u043d\u0438\u043c. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0438\u043c\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a: <code>v-for=\u00abitem in items\u00bb<\/code>.<\/li>\n<li>\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0447\u0435\u0447\u043d\u0443\u044e \u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/li>\n<li>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>v-for<\/code> \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447.<\/li>\n<\/ul>\n<p>  \u0417\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e Vue, \u0437\u0430\u043d\u0438\u043c\u0430\u044f\u0441\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u0443\u0440\u0441\u0443?<\/p>\n<p>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/509700\/\">Vue.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0443\u0440\u043e\u043a 1: \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Vue<\/a><br \/>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/509702\/\">Vue.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0443\u0440\u043e\u043a 2: \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/a><br \/>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/510628\/\">Vue.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0443\u0440\u043e\u043a 3: \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433<\/a><\/p>\n<p>  <a href=\"http:\/\/ruvds.com\/ru-rub?utm_source=habr&amp;utm_medium=perevod&amp;utm_campaign=vuelesson4#order\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/de\/0y\/l-\/de0yl-6ppopvisr_a80b4yuhjj8.png\"><\/a><\/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\/company\/ruvds\/blog\/510898\/\"> https:\/\/habr.com\/ru\/company\/ruvds\/blog\/510898\/<\/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\/company\/ruvds\/blog\/510898\/\">\u0421\u0435\u0433\u043e\u0434\u043d\u044f, \u0432 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u0443\u0447\u0435\u0431\u043d\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u0430 \u043f\u043e Vue, \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441\u043f\u0438\u0441\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/510898\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uy\/q3\/gm\/uyq3gma9wtrfx0egg8ct5direys.jpeg\"><\/a><\/p>\n<p>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/509700\/\">Vue.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0443\u0440\u043e\u043a 1: \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Vue<\/a><br \/>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/509702\/\">Vue.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0443\u0440\u043e\u043a 2: \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432<\/a><br \/>  \u2192 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/510628\/\">Vue.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445, \u0443\u0440\u043e\u043a 3: \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433<\/a>  <\/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-306980","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306980","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=306980"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306980\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}