{"id":304562,"date":"2020-05-31T09:00:16","date_gmt":"2020-05-31T09:00:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304562"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304562","title":{"rendered":"Alpine.js \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435"},"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\/504650\/\">\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u043f\u0440\u043e Alpine.js. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u044d\u0442\u043e &quot;Vue.js \u043d\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u043a\u0430\u0445&quot;. &quot;Angular 1 \u0434\u043b\u044f \u043c\u0438\u043b\u043b\u0435\u043d\u0438\u0430\u043b\u043e\u0432&quot;. \u041d\u0430\u0437\u044b\u0432\u0430\u0439\u0442\u0435, \u043a\u0430\u043a \u0445\u043e\u0442\u0438\u0442\u0435, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u043c \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a? \u041d\u0443, Alpine \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0432\u043e\u044e \u043d\u0438\u0448\u0443. \u041f\u043e \u0444\u0430\u043a\u0442\u0443, \u043e\u043d \u2013 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432, \u0433\u0434\u0435 \u044d\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u043d\u044f, \u043c\u043e\u0434\u043d\u043e\u0433\u043e web-developer&#8217;\u0430, \u0437\u0430\u043f\u0440\u044f\u0433\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0439 \u0441\u0430\u0439\u0442. \u041c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0438 \u0432\u0441\u044f\u043a\u0438\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432. \u0427\u0442\u043e \u044f \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c? \u0412\u043e\u0437\u044c\u043c\u0443 jQuery \u2013 \u0434\u0440\u0443\u0437\u044c\u044f \u043d\u0435 \u043f\u043e\u0439\u043c\u0443\u0442, \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c JS \u0432\u0441\u0451 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e\u0436\u0435 \u043d\u0435 \u043a\u043e\u043c\u0438\u043b\u044c\u0444\u043e. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u044f \u0443\u0436\u0435 \u0437\u043d\u0430\u044e \u0440\u0435\u0430\u043a\u0442\u044b, \u0430\u043d\u0433\u0443\u043b\u044f\u0440\u044b \u0438 \u0432\u044c\u044e, \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 data-driven \u043f\u043e\u0434\u0445\u043e\u0434. \u041a\u0430\u043a \u043c\u043d\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0432 HTML \u0445\u0440\u0430\u043d\u0438\u0442\u044c?<\/p>\n<p>  <\/p>\n<p>\u0422\u0443\u0442 \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c Alpine.js. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, Vue \u0438\u043b\u0438 React \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c. \u041d\u043e React \u0431\u0435\u0437 JSX \u043d\u0438\u043a\u0442\u043e \u0432 \u0437\u0434\u0440\u0430\u0432\u043d\u043e\u043c \u0443\u043c\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0430 Vue \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 CDN \u0432\u0435\u0441\u0438\u0442 34 kB (\u043f\u0440\u043e\u0442\u0438\u0432 8.1 kB \u0443 Alpine). \u0422\u0430\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 Alpine.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0442\u0443\u0442 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/501312\/\">\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e Alpine.js<\/a>. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u0430\u0439\u0442 \u0432\u044b\u0440\u0435\u0437\u0430\u043b \u0432\u0435\u0437\u0434\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u043f\u0440\u043e \u0442\u0435\u0433 template, \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u0435.<\/p>\n<p>  <\/p>\n<p>\u042f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f, \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0435\u0440\u0435\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/alpinejs\/alpine\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>, \u0431\u043b\u0430\u0433\u043e \u043e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f (\u0432\u0435\u0441\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u2013 \u044d\u0442\u043e 13 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432 \u0438 6 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432) \u0438 \u0441\u043a\u043e\u0440\u043e \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 (\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043e\u0431\u0440\u0435\u043d\u0438\u0438 \u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044f, \u043d\u043e \u0435\u0433\u043e \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/evgeniyPP\/alpine\/blob\/russian-docs\/README.ru.md\">\u0432 \u043c\u043e\u0435\u043c \u0444\u043e\u0440\u043a\u0435<\/a>).<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438\/\u0438\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 Vue, \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e. \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0441 Vue \u0437\u043d\u0430\u043a\u043e\u043c, \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u0439:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0412\u0435\u0437\u0434\u0435 \u0432\u043c\u0435\u0441\u0442\u043e <code>v-<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>x-<\/code>, \u0442.\u0435. \u043d\u0435 <code>v-model<\/code>, \u0430 <code>x-model<\/code>; \u043d\u0435 <code>v-bind<\/code>, \u0430 <code>x-bind<\/code> \u041f\u043e\u0447\u0435\u043c\u0443? \u042d\u0442\u043e \u0432\u0430\u0448\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0430 \u0434\u043e\u043c \ud83d\ude42<\/li>\n<li><code>x-if<\/code> \u0438 <code>x-for<\/code> \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u0435\u0433\u0435 template. \u0418\u0437\u0434\u0435\u0440\u0436\u043a\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f Virtual DOM.<\/li>\n<li>\u0412\u0441\u0435\u043c\u0438 \u043b\u044e\u0431\u0438\u043c\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u0438 <code>{{}}<\/code> \u043d\u0435\u0442. \u041f\u0438\u0448\u0438\u0442\u0435 <code>x-text<\/code> \u0438 <code>x-html<\/code>, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u043c\u0443\u0436\u0438\u043a\u0438 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u0432\u043e Vue.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041e\u0431 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u044f \u0441\u043b\u0430\u0431\u0430\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u0441\u0435\u043c \u043d\u0435\u043d\u0430\u0432\u0438\u0441\u0442\u043d\u044b\u0439 \u0442\u0443\u0434\u0443\u0448\u043d\u0438\u043a. \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u043e\u0435? \u041f\u0435\u0440\u0432\u043e\u0435 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u0438\u0435 \u044f \u0443\u0436\u0435 \u043d\u0430\u0437\u0432\u0430\u043b \u2013 \u043f\u043b\u043e\u0445\u0430\u044f \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u044f. \u0412\u0442\u043e\u0440\u043e\u0435 \u2013 \u0432\u0441\u0435 \u0443\u0436\u0435 \u043d\u0430\u0438\u0437\u0443\u0441\u0442\u044c \u0437\u043d\u0430\u044e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0443\u0434\u0443\u0448\u043a\u0438, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0435 \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u0442\u0441\u044f \u043d\u0430 \u0438\u0434\u0435\u044e, \u0430 \u0441\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0422\u0440\u0435\u0442\u044c\u0435 \u0438 \u043c\u043e\u0435 \u043b\u044e\u0431\u0438\u043c\u043e\u0435 \u2013 &quot;\u0432 \u0442\u0443\u0434\u0443 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b&quot; \u0438 \u0442.\u0434. \u0438 \u0442.\u043f.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0440\u043e\u0447\u0435, \u0432\u043e\u0434\u0443 \u043b\u0438\u0442\u044c \u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043a\u043e\u0434.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0433\u043e\u043b\u043e\u0433\u043e HTML, \u043a\u0443\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 CDN \u0432\u0441\u0442\u0430\u0432\u0438\u043c Alpine<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html lang=&quot;ru&quot;&gt;   &lt;head&gt;     &lt;meta charset=&quot;UTF-8&quot; \/&gt;     &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; \/&gt;     &lt;title&gt;To-Do \u043d\u0430 Alpine.js&lt;\/title&gt;     &lt;script       src=&quot;https:\/\/cdn.jsdelivr.net\/gh\/alpinejs\/alpine@v2.3.5\/dist\/alpine.min.js&quot;       defer     &gt;&lt;\/script&gt;   &lt;\/head&gt;   &lt;body&gt;&lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>Alpine \u0441\u0430\u043c\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u0438\u0447\u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e. \u041e\u043d \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435? \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b <code>x-data<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div x-data=&quot;{ name: '\u0416\u0435\u043d\u044f' }&quot;&gt;   &lt;p&gt;\u041f\u0440\u0438\u0432\u0435\u0442, &lt;span x-text=&quot;name&quot;&gt;&lt;\/span&gt;&lt;\/p&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 <code>&lt;div&gt;<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c, \u0441\u0432\u043e\u0435\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>name<\/code> \u0432\u043d\u0435 \u044d\u0442\u043e\u0433\u043e <code>&lt;div&gt;<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c to-do. \u041d\u0430\u0447\u043d\u0435\u043c \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div   x-data=&quot;{ todos: [{id: 1, title: '\u043a\u0443\u043f\u0438\u0442\u044c \u0445\u043b\u0435\u0431', completed: false}, {id: 2, title: '\u043f\u0440\u043e\u0434\u0430\u0442\u044c \u0430\u0439\u0444\u043e\u043d', completed: false}, {id: 3, title: '\u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u0443\u0440\u0441', completed: false}, {id: 4, title: '\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0431\u044b\u0442\u044c \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u043c', completed: false}] }&quot; &gt;   &lt;h1&gt;\u041f\u043b\u0430\u043d\u044b \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f:&lt;\/h1&gt;   &lt;ul&gt;     &lt;template x-for=&quot;todo in todos&quot; :key=&quot;todo.id&quot;&gt;       &lt;li x-text=&quot;todo.title&quot;&gt;&lt;\/li&gt;     &lt;\/template&gt;   &lt;\/ul&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u043a\u043b\u0438\u043a \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0443\u0434\u0443. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c CSS-\u043a\u043b\u0430\u0441\u0441 <code>.completed<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>x-bind:class<\/code> (\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code>{[\u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430]: [\u0443\u0441\u043b\u043e\u0432\u0438\u0435]}<\/code>). \u0415\u0449\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c <code>cursor: pointer<\/code> \u043d\u0430 <code>li<\/code>, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;style&gt;   .completed {     text-decoration: line-through;   }    li {     cursor: pointer;   } &lt;\/style&gt;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div   x-data=&quot;{ todos: [{id: 1, title: '\u043a\u0443\u043f\u0438\u0442\u044c \u0445\u043b\u0435\u0431', completed: false}, {id: 2, title: '\u043f\u0440\u043e\u0434\u0430\u0442\u044c \u0430\u0439\u0444\u043e\u043d', completed: false}, {id: 3, title: '\u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u0443\u0440\u0441', completed: false}, {id: 4, title: '\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0431\u044b\u0442\u044c \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u043c', completed: false}], toggleTodo: function(id) { var todo = this.todos.find((todo) =&gt; todo.id === id); todo.completed = !todo.completed; } }&quot; &gt;   &lt;h1&gt;\u041f\u043b\u0430\u043d\u044b \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f:&lt;\/h1&gt;   &lt;ul&gt;     &lt;template x-for=&quot;todo in todos&quot; :key=&quot;todo.id&quot;&gt;       &lt;li         x-text=&quot;todo.title&quot;         @click=&quot;toggleTodo(todo.id)&quot;         :class=&quot;{'completed': todo.completed}&quot;       &gt;&lt;\/li&gt;     &lt;\/template&gt;   &lt;\/ul&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442\u044c \u043e\u0442\u0441\u0442\u043e\u0439\u043d\u043e \u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f. \u0411\u043b\u0430\u0433\u043e, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043d\u0430\u043c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 <code>x-data<\/code> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div x-data=&quot;todos()&quot;&gt;   &lt;h1&gt;\u041f\u043b\u0430\u043d\u044b \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f:&lt;\/h1&gt;   &lt;ul&gt;     &lt;template x-for=&quot;todo in todos&quot; :key=&quot;todo.id&quot;&gt;       &lt;li         x-text=&quot;todo.title&quot;         @click=&quot;toggleTodo(todo.id)&quot;         :class=&quot;{'completed': todo.completed}&quot;       &gt;&lt;\/li&gt;     &lt;\/template&gt;   &lt;\/ul&gt; &lt;\/div&gt;  &lt;script&gt;   function todos() {     return {       todos: [         { id: 1, title: '\u043a\u0443\u043f\u0438\u0442\u044c \u0445\u043b\u0435\u0431', completed: false },         { id: 2, title: '\u043f\u0440\u043e\u0434\u0430\u0442\u044c \u0430\u0439\u0444\u043e\u043d', completed: false },         { id: 3, title: '\u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u0443\u0440\u0441', completed: false },         { id: 4, title: '\u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0431\u044b\u0442\u044c \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u044b\u043c', completed: false },       ],       toggleTodo: function (id) {         var todo = this.todos.find((todo) =&gt; todo.id === id);         todo.completed = !todo.completed;       },     };   } &lt;\/script&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u2026 \u0438 \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 Vue.<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c input \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447:<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div x-data=&quot;todos()&quot;&gt;   &lt;!-- ... --&gt;   &lt;div&gt;     &lt;h4&gt;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443:&lt;\/h4&gt;     &lt;input type=&quot;text&quot; x-model=&quot;inputValue&quot; \/&gt;     &lt;button @click=&quot;addTodo()&quot;&gt;\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c&lt;\/button&gt;   &lt;\/div&gt; &lt;\/div&gt;  &lt;script&gt;   function todos() {     return {       \/\/ ...       inputValue: '',       addTodo: function () {         if (!this.inputValue) {           return;         }          this.todos.push({           id: Date.now(),           title: this.inputValue,           completed: false,         });         this.inputValue = '';       },     };   } &lt;\/script&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u0430 <code>push()<\/code> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b Alpine \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043d\u0430\u0434\u043e \u043c\u0435\u043d\u044f\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0442\u0440\u0438\u0445 \u2013 \u043a\u043d\u043e\u043f\u043a\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0442\u0443\u0434\u0443. \u0412 <code>&lt;li&gt;<\/code> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 <code>span<\/code>: \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043a\u0441\u0442, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2013 \u043a\u0440\u0435\u0441\u0442\u0438\u043a.<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;ul&gt;   &lt;template x-for=&quot;todo in todos&quot; :key=&quot;todo.id&quot;&gt;     &lt;li @click=&quot;toggleTodo(todo.id)&quot; :class=&quot;{'completed': todo.completed}&quot;&gt;       &lt;span x-text=&quot;todo.title&quot;&gt;&lt;\/span&gt;       &lt;span @click=&quot;deleteTodo(todo.id)&quot;&gt;&amp;times;&lt;\/span&gt;     &lt;\/li&gt;   &lt;\/template&gt; &lt;\/ul&gt;  &lt;script&gt;   function todos() {     return {       \/\/ ...       deleteTodo: function (id) {         this.todos = this.todos.filter((todo) =&gt; todo.id !== id);       },     };   } &lt;\/script&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0443\u0434\u0443\u0448\u043d\u0438\u043a \u0433\u043e\u0442\u043e\u0432\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u043f\u0443\u0449\u0435\u0433\u043e \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f, \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0437\u0430\u0431\u0438\u0440\u0430\u044f \u043d\u0430\u0448\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 REST API. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0430\u043f\u0438\u0448\u043a\u043e\u0439 \u043d\u0430\u043c \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u0434\u0430\u043b\u044c\u043d\u044b\u0439 <a href=\"https:\/\/jsonplaceholder.typicode.com\/\">JSON Placeholder<\/a>. \u0410 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>x-init<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div x-data=&quot;todos()&quot; x-init=&quot;fetchTodos()&quot;&gt;   &lt;!-- ... --&gt; &lt;\/div&gt;  &lt;script&gt;   function todos() {     return {       \/\/ ...       todos: [],       fetchTodos: function () {         fetch('https:\/\/jsonplaceholder.typicode.com\/todos')           .then((response) =&gt; response.json())           .then((data) =&gt; {             this.todos = data.slice(0, 10);           });       },     };   } &lt;\/script&gt;<\/code><\/pre>\n<p>  <\/p>\n<p><code>x-init<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 DOM (\u0430\u043d\u0430\u043b\u043e\u0433 <code>created<\/code> \u0432\u043e Vue). \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u043e\u043b\u0431\u044d\u043a \u2013 \u0442\u043e, \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u0430\u043d\u0430\u043b\u043e\u0433 <code>mounted<\/code>).<br \/>  \u0418 \u0434\u0430, \u044f \u0437\u043d\u0430\u044e \u043f\u0440\u043e <code>?_limit=10<\/code>, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 query \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c. \u041c\u044b \u043e\u0445\u0432\u0430\u0442\u0438\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Alpine.js. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/alpinejs\/alpine\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0432\u0441\u0451 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u041d\u043e, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u043b\u0435\u0433\u0447\u0435 \u0432 \u043d\u0435\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0443\u0440\u043e\u043a\u0430 \u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u0432 <a href=\"https:\/\/codesandbox.io\/s\/todo-list-alpine-5mwy9?file=\/index.html\">\u044d\u0442\u043e\u0442 sandbox<\/a>. \u0414\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u0433\u043b\u0430\u0437\u0430 \u043d\u0435 \u0440\u0435\u0437\u0430\u043b\u043e, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0441\u0451 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435.<\/p>\n<p>  <\/p>\n<blockquote><p>P.S. \u0414\u043b\u044f \u0430\u043d\u0433\u043b\u043e\u0433\u043e\u0432\u043e\u0440\u044f\u0449\u0438\u0445 \u0435\u0449\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u0442\u044c &quot;\u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439&quot; \u0441\u043a\u0440\u0438\u043d\u043a\u0430\u0441\u0442 \u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044f Alpine.js. \u041e\u043d \u0442\u0430\u043a \u0445\u043e\u0440\u043e\u0448, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u0436\u0430\u043b\u043a\u043e \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f. \u041d\u0443 \u043b\u0430\u0434\u043d\u043e, <a href=\"https:\/\/laracasts.com\/series\/building-alpinejs\">\u0432\u043e\u0442<\/a>. \u0412 \u043d\u0435\u043c \u0430\u0432\u0442\u043e\u0440 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043a\u0430\u043a Alpine, \u0438 \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f.<\/p><\/blockquote>\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\/504650\/\"> https:\/\/habr.com\/ru\/post\/504650\/<\/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\/504650\/\">\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u043f\u0440\u043e Alpine.js. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u044d\u0442\u043e &quot;Vue.js \u043d\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u043a\u0430\u0445&quot;. &quot;Angular 1 \u0434\u043b\u044f \u043c\u0438\u043b\u043b\u0435\u043d\u0438\u0430\u043b\u043e\u0432&quot;. \u041d\u0430\u0437\u044b\u0432\u0430\u0439\u0442\u0435, \u043a\u0430\u043a \u0445\u043e\u0442\u0438\u0442\u0435, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u043c \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a? \u041d\u0443, Alpine \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0432\u043e\u044e \u043d\u0438\u0448\u0443. \u041f\u043e \u0444\u0430\u043a\u0442\u0443, \u043e\u043d \u2013 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432, \u0433\u0434\u0435 \u044d\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u043d\u044f, \u043c\u043e\u0434\u043d\u043e\u0433\u043e web-developer&#8217;\u0430, \u0437\u0430\u043f\u0440\u044f\u0433\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0439 \u0441\u0430\u0439\u0442. \u041c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0438 \u0432\u0441\u044f\u043a\u0438\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432. \u0427\u0442\u043e \u044f \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c? \u0412\u043e\u0437\u044c\u043c\u0443 jQuery \u2013 \u0434\u0440\u0443\u0437\u044c\u044f \u043d\u0435 \u043f\u043e\u0439\u043c\u0443\u0442, \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c JS \u0432\u0441\u0451 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e\u0436\u0435 \u043d\u0435 \u043a\u043e\u043c\u0438\u043b\u044c\u0444\u043e. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u044f \u0443\u0436\u0435 \u0437\u043d\u0430\u044e \u0440\u0435\u0430\u043a\u0442\u044b, \u0430\u043d\u0433\u0443\u043b\u044f\u0440\u044b \u0438 \u0432\u044c\u044e, \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 data-driven \u043f\u043e\u0434\u0445\u043e\u0434. \u041a\u0430\u043a \u043c\u043d\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0432 HTML \u0445\u0440\u0430\u043d\u0438\u0442\u044c?<\/p>\n<p>  <\/p>\n<p>\u0422\u0443\u0442 \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c Alpine.js. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, Vue \u0438\u043b\u0438 React \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c. \u041d\u043e React \u0431\u0435\u0437 JSX \u043d\u0438\u043a\u0442\u043e \u0432 \u0437\u0434\u0440\u0430\u0432\u043d\u043e\u043c \u0443\u043c\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0430 Vue \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 CDN \u0432\u0435\u0441\u0438\u0442 34 kB (\u043f\u0440\u043e\u0442\u0438\u0432 8.1 kB \u0443 Alpine). \u0422\u0430\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 Alpine.<\/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-304562","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304562","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=304562"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304562\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}