{"id":322827,"date":"2021-05-10T09:00:18","date_gmt":"2021-05-10T09:00:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=322827"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=322827","title":{"rendered":"Vue.js \u0438 \u0441\u043b\u043e\u0438\u0441\u0442\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430: \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u044b"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0433\u0438\u0431\u043a\u0438\u043c \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c, \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0435\u0432. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u043a\u0430\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c, \u0442\u0430\u043a \u0438 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c Vue.js, React.js, Angular.&nbsp;<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0440\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 JQuery \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f, \u0430 \u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043b\u0438\u0448\u044c \u0447\u0438\u0442\u0430\u043b\u0438 \u0432 \u0440\u0435\u0434\u043a\u0438\u0445 \u043d\u043e\u0432\u043e\u0441\u0442\u044f\u0445, \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u0438 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c MVC (Model-View-Controller): \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 (controller) \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043e\u0442\u0432\u0435\u0447\u0430\u043b \u0437\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438 (model) \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (view), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u043b\u043e HTML.&nbsp;<\/p>\n<p>\u041e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u041e\u041e\u041f) \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0448\u0430\u043b\u0438, \u0433\u0434\u0435 \u0438 \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 \u043c\u0438\u0440\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u0440\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435, \u043a\u0430\u043a \u00ab<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%91%D0%BE%D0%B6%D0%B5%D1%81%D1%82%D0%B2%D0%B5%D0%BD%D0%BD%D1%8B%D0%B9_%D0%BE%D0%B1%D1%8A%D0%B5%D0%BA%D1%82\"><u>\u0411\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b<\/u><\/a>\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u043b\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430 \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0431\u044b\u043b\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u00ab\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u00bb, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u043a\u043b\u0430\u0441\u0441 User \u0438 \u0432 \u043d\u0435\u043c \u043f\u0438\u0441\u0430\u043b\u0430\u0441\u044c \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438. \u0411\u0435\u0437 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0435\u0449\u0451 \u0444\u0430\u0439\u043b\u044b. \u0418 \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0433 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ec9\/a17\/18d\/ec9a1718daa78ed829756c2fece0ea2a.gif\" width=\"480\" height=\"270\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043f\u0435\u0440\u0432\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438 \u0441\u0442\u0430\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u043d\u043e \u043e\u043d\u0438 \u043d\u0435 \u0443\u0447\u0438\u043b\u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0418 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u043d\u043e\u0432\u043e\u043c\u043e\u0434\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432.<\/p>\n<h3>1. \u0412\u044b\u0445\u043e\u0434 \u0435\u0441\u0442\u044c<\/h3>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, Vue.js, React.js \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445. \u0422\u043e \u0435\u0441\u0442\u044c, \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0435\u0449\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043f\u0438\u0448\u0443\u0442 \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 \u0438 \u044d\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0431\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043a\u0440\u0443\u043f\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439) \u043b\u043e\u0433\u0438\u043a\u0438, \u0442\u043e \u0432\u0441\u044f \u044d\u0442\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435. \u041f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430. \u0410 \u0435\u0441\u043b\u0438 \u0443\u0447\u0435\u0441\u0442\u044c \u0442\u043e, \u0447\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e Vue.js \u0435\u0449\u0435 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u044f \u043a\u0430\u043a computed, watch, mounted, created, \u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0438\u0448\u0443\u0442 \u0435\u0449\u0435 \u0438 \u0432\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u0412 \u0438\u0442\u043e\u0433\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0443\u044e \u0437\u0430 \u043a\u043b\u0438\u043a \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435, \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043b\u0438\u0441\u0442\u0430\u0442\u044c \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u043e\u0432 js-\u043a\u043e\u0434\u0430, \u0431\u0435\u0433\u0430\u044f \u043c\u0435\u0436\u0434\u0443 methods, computed \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/118\/b35\/c0e\/118b35c0ed8a3e33a06eb2340786fcfe.gif\" width=\"480\" height=\"276\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 2008 \u0433\u043e\u0434\u0443, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a backend, \u0431\u044b\u043b\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0430 \u201c\u0441\u043b\u043e\u0438\u0441\u0442\u0430\u044f\u201d \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u044d\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u044e\u0442 \u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u043e\u044f\u0445.<\/p>\n<p>\u0421 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c, \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0437\u043e\u043d\u044b \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u0434.<\/p>\n<p>\u0412\u043e\u0442 \u043e \u0442\u0430\u043a\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0441\u043b\u043e\u0438 \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c, \u043d\u043e \u0443\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a frontend-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a Vue.js, React.js \u0438 \u043f\u0440\u043e\u0447\u0438\u043c.&nbsp;<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043e\u0440\u0438\u044f \u201c\u0441\u043b\u043e\u0438\u0441\u0442\u043e\u0439\u201d \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a backend, \u0438\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b. \u0418\u0434\u0435\u044f \u0436\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043d\u044f\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b \u043d\u0430 \u0441\u043b\u043e\u0438. \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d69\/d7c\/034\/d69d7c0347e2b02706525f974ef83033.png\" width=\"412\" height=\"254\"><figcaption><\/figcaption><\/figure>\n<h2>2. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f  <\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435.  <\/p>\n<h4>2.1. \u041b\u043e\u0433\u0438\u043a\u0430 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043a\u043e\u043b\u043b\u0430\u0436\u0430\u043c\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435. \u0412 \u043d\u0435\u043c \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u043c\u043d\u043e\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<pre><code class=\"javascript\">methods: {     duplicateCollage (collage) {       this.$store.dispatch('updateCollage', { id: collage.id, isDuplicating: true })       dataService.duplicateCollage(collage, false)         .then(duplicate =&gt; {           this.$store.dispatch('updateCollage', { id: collage.id, isDuplicating: false })         })         .catch(() =&gt; {           this.$store.dispatch('updateCollage', { id: collage.id, isDuplicating: false })           this.$store.dispatch('errorsSet', { api: `We couldn't duplicate collage. Please, try again later.` })         })     },     deleteCollage (collage, index) {       this.$store.dispatch('updateCollage', { id: collage.id, isDeleting: true })       photosApi.deleteUserCollage(collage)         .then(() =&gt; {           this.$store.dispatch('updateCollage', {             id: collage.id,             isDeleting: false,             isDeleted: true           })           this.$store.dispatch('setUserCollages', { total: this.userCollages.total - 1 })           this.$store.dispatch('updateCollage', {             id: collage.id,             deletingTimer: setTimeout(() =&gt; {               this.$store.dispatch('updateCollage', { id: collage.id, deletingTimer: null })               this.$store.dispatch('setUserCollages', { items: this.userCollages.items.filter(userCollage =&gt; userCollage.id !== collage.id) })                 \/\/ If there is no one collages left - show templates               if (!this.$store.state.editor.userCollages.total) {                 this.currentTabName = this.TAB_TEMPLATES               }             }, 3000)           })         })     },     restoreCollage (collage) {       clearTimeout(collage.deletingTimer)       photosApi.saveUserCollage({ collage: { deleted: false } }, collage.id)         .then(() =&gt; {           this.$store.dispatch('updateCollage', {             id: collage.id,             deletingTimer: null,             isDeleted: false           })           this.$store.dispatch('setUserCollages', { total: this.userCollages.total + 1 })         })     } }<\/code><\/pre>\n<h4>2.2. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0437\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443.<\/p>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438 \u2013 \u044d\u0442\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u043b\u0438, \u043a\u0430\u043a \u0432 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u041a\u043e\u043b\u043b\u0430\u0436. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 services \u0438 \u0432 \u043d\u0435\u0439 \u2013 \u0444\u0430\u0439\u043b\u044b user.js \u0438 collage.js. \u0422\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2013 \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c\u044e, \u0431\u044b\u043b\u0430 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435.<\/p>\n<pre><code class=\"javascript\">services   |_collage.js   |_user.js<\/code><\/pre>\n<p>\u0412 \u0441\u0435\u0440\u0432\u0438\u0441 collage.js \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0430\u0436\u0435\u0439.  <\/p>\n<pre><code class=\"javascript\">export default class Collage {   static delete (collage) {     \/\/ \u041b\u041e\u0413\u0418\u041a\u0410 \u0423\u0414\u0410\u041b\u0415\u041d\u0418\u042f \u041a\u041e\u041b\u041b\u0410\u0416\u0410   }     static restore (collage) {     \/\/ \u041b\u041e\u0413\u0418\u041a\u0410 \u0412\u041e\u0421\u0421\u0422\u0410\u041d\u041e\u0412\u041b\u0415\u041d\u0418\u042f  \u041a\u041e\u041b\u041b\u0410\u0416\u0410   }     static duplicate (collage, changeUrl = true) {     \/\/ \u041b\u041e\u0413\u0418\u041a\u0410 \u0414\u0423\u0411\u041b\u0418\u0420\u041e\u0412\u0410\u041d\u0418\u042f \u041a\u041e\u041b\u041b\u0410\u0416\u0410   } }<\/code><\/pre>\n<h4>2.3. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435<\/h4>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0438\u0448\u044c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<pre><code class=\"javascript\">methods: {   duplicateCollage (collage) {     CollageService.duplicate(collage, false)   },   deleteCollage (collage) {     CollageService.delete(collage)   },   restoreCollage (collage) {     CollageService.restore(collage)   } }<\/code><\/pre>\n<p>\u0421 \u0442\u0430\u043a\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043a\u043e\u0434\u0430, \u0430 \u043b\u043e\u0433\u0438\u043a\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u043a\u043e\u043b\u043b\u0430\u0436\u0430\u043c\u0438, \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0444\u0430\u0439\u043b\u0435 collage.js, \u0430 \u043d\u0435 \u0440\u0430\u0437\u043c\u0430\u0437\u0430\u043d\u0430 \u043f\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u0434, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b. \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u043b\u044e\u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u0434 \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 \u043f\u0443\u0442\u0438 \u043a \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0432\u044b\u043d\u043e\u0441\u044f\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 API \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b (\u0444\u0430\u0439\u043b\u044b). \u042d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 API, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0443 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<pre><code class=\"javascript\">import axios from '@\/plugins\/axios'   export default class Api {     static login (email, password) {     return axios.post('auth\/login', { email, password })       .then(response =&gt; response.data)   }     static logout () {     return axios.post('auth\/logout')   }     static getCollages () {     return axios.get('\/collages')       .then(response =&gt; response.data)   }      static deleteCollage (collage) {     return axios.delete(`\/collage\/${collage.id}`)       .then(response =&gt; response.data)   }      static createCollage (collage) {     return axios.post(`\/collage\/${collage.id}`)       .then(response =&gt; response.data)   } }<\/code><\/pre>\n<h3>3. \u0427\u0442\u043e \u0438 \u043a\u0443\u0434\u0430 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c?<\/h3>\n<p>\u041d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u0447\u0442\u043e \u0436\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0438 \u043a\u0443\u0434\u0430 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c, \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u0442\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438: \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430, \u043b\u043e\u0433\u0438\u043a\u0430 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0411\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u2013 \u044d\u0442\u043e \u0432\u0441\u0435 \u0442\u043e, \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0422\u0417, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0434\u0438\u0437\u0430\u0439\u043d\u044b. \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>UserService.login()<\/em> \u0438\u043b\u0438 <em>ListService.sort()<\/em>. \u0414\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u2013 \u044d\u0442\u043e \u0442\u043e\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043a \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0435\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. \u0414\u043b\u044f \u043b\u043e\u0433\u0438\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u043e\u0439 \u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0430\u043f\u043a\u0443 helpers \u0438 \u0432 \u043d\u0435\u0439 \u0444\u0430\u0439\u043b\u044b string.js, converter.js \u0438 \u043f\u0440\u043e\u0447\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u2013 \u0432\u0441\u0435 \u0442\u043e, \u0447\u0442\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c \u0438 \u0435\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 (methods, computed, watch \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435).<\/p>\n<pre><code class=\"javascript\">login (email, password) {   this.isLoading = true   userService.login(email, password)     .then(user =&gt; {       this.user = user       this.isLoading = false     }) }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u044d\u043b\u043f\u0435\u0440\u044b. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043d\u0430\u043c \u043b\u0435\u0433\u043a\u0438\u0435, \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0430 \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438\u043b\u0438 \u0445\u044d\u043b\u043f\u0435\u0440\u044b \u043d\u0430\u0447\u043d\u0443\u0442 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f, \u0442\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0435\u0441\u043b\u0438 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 3-5 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043f\u0430\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u043e \u0437\u0430\u043a\u0430\u0437\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432\u0441\u044e \u044d\u0442\u0443 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 user.js\u0440\u0435\u0448\u0438\u0442\u044c \u0432\u0441\u044e \u044d\u0442\u0443 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0435 user.js. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u043e\u0442\u043d\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0437\u0430\u043a\u0430\u0437\u0430\u043c, \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441 order.js.<\/p>\n<h3>4. \u041e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443<\/h3>\n<p>\u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043d\u0430 \u041e\u041e\u041f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442, \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0435\u0449\u0435 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u042d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u044b, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422\u0435 \u0436\u0435 User \u0438\u043b\u0438 Collage. \u041d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0432\u043e\u0434\u0430 \u0424\u0418\u041e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a.<\/p>\n<pre><code class=\"javascript\">&lt;template&gt; &lt;div class=\"users\"&gt;   &lt;div     v-for=\"user in users\"     class=\"user\"   &gt;     {{ getUserFio(user) }}   &lt;\/div&gt; &lt;\/div&gt; &lt;\/template&gt;   &lt;script&gt; import axios from '@\/plugins\/axios'   export default {   data () {     return {       users: []     }   },   mounted () {     this.getList()   },   methods: {     getList() {       axios.get('\/users')         .then(response =&gt; this.users = response.data)     },     getUserFio (user) {       return `${user.last_name} ${user.first_name} ${user.third_name}`     }   } } &lt;\/script&gt;<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0424\u0418\u041e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043b\u0435\u0433\u043a\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c.  <\/p>\n<pre><code class=\"javascript\">export default class User {   constructor (data = {}) {     this.firstName = data.first_name     this.secondName = data.second_name     this.thirdName = data.third_name   }     getFio () {     return `${this.firstName} ${this.secondName} ${this.thirdName}`   } }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442.  <\/p>\n<pre><code class=\"javascript\">import UserModel from '@\/models\/user'<\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 (\u043c\u043e\u0434\u0435\u043b\u0438) User.  <\/p>\n<pre><code class=\"javascript\">methods: {    getList() {      const users = userService.getList()      users.forEach(user =&gt; {        this.users.push(new UserModel(user))      })    },<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c, \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0438\u043b\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043d\u0435 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0443\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<pre><code class=\"javascript\">&lt;template&gt; &lt;div class=\"users\"&gt;   &lt;div     v-for=\"user in users\"     class=\"user\"   &gt;     {{ user.getFio() }}   &lt;\/div&gt; &lt;\/div&gt; &lt;\/template&gt;<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/76b\/3d5\/230\/76b3d52302ba04c13f621d61fd47bbdc.png\" width=\"312\" height=\"262\"><figcaption><\/figcaption><\/figure>\n<p>\u041a \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c \u0432 \u043c\u043e\u0434\u0435\u043b\u0438, \u0430 \u043a\u0430\u043a\u0443\u044e \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u044b. \u041c\u043e\u0436\u043d\u043e \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0430 \u0432 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b. \u0410 \u043c\u043e\u0436\u043d\u043e \u0432 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0443\u044e\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 (\u0442\u043e\u0442 \u0436\u0435 <em>getFio()<\/em>), \u0430 \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 (\u0442\u043e\u0442 \u0436\u0435 <em>getList()<\/em>). \u041a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u0435\u0435.  <\/p>\n<h3>5. \u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043b\u043e\u0433\u0438\u043a\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445, \u0435\u0441\u0442\u044c \u0440\u0438\u0441\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0442\u0440\u0443\u0434\u043d\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c\u0438 \u0438 \u043e\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u043a\u0438. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u201c\u0441\u043b\u043e\u0438\u201d \u0434\u043b\u044f \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438, \u0441\u043b\u043e\u0439 \u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438. \u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441\u0442\u043e\u0438\u0442 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0443 \u043b\u043e\u0433\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043d\u0435\u043c\u0443 \u0438 \u0435\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u043e\u0438 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0441\u0435\u0441\u0441\u0438\u044f\u043c\u0438, \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0447\u0438\u043a\u0430\u043c\u0438 (interceptors)  api, \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u2013 \u0441\u043c\u043e\u0442\u0440\u044f \u0447\u0442\u043e \u0432\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438, \u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f&nbsp;\u0442\u0430\u043c, \u0433\u0434\u0435 \u0435\u0435 \u043b\u0435\u0433\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0438 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p><strong>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0434\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u0430\u0448\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.&nbsp;<\/strong><\/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\/company\/simbirsoft\/blog\/556270\/\"> https:\/\/habr.com\/ru\/company\/simbirsoft\/blog\/556270\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0433\u0438\u0431\u043a\u0438\u043c \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c, \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0435\u0432. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u043a\u0430\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c, \u0442\u0430\u043a \u0438 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c Vue.js, React.js, Angular.&nbsp;<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0440\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 JQuery \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f, \u0430 \u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043b\u0438\u0448\u044c \u0447\u0438\u0442\u0430\u043b\u0438 \u0432 \u0440\u0435\u0434\u043a\u0438\u0445 \u043d\u043e\u0432\u043e\u0441\u0442\u044f\u0445, \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u0438 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c MVC (Model-View-Controller): \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 (controller) \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043e\u0442\u0432\u0435\u0447\u0430\u043b \u0437\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438 (model) \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (view), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0440\u0438\u0441\u043e\u0432\u0430\u043b\u043e HTML.&nbsp;<\/p>\n<p>\u041e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u041e\u041e\u041f) \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0448\u0430\u043b\u0438, \u0433\u0434\u0435 \u0438 \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 \u043c\u0438\u0440\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u0440\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435, \u043a\u0430\u043a \u00ab<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%91%D0%BE%D0%B6%D0%B5%D1%81%D1%82%D0%B2%D0%B5%D0%BD%D0%BD%D1%8B%D0%B9_%D0%BE%D0%B1%D1%8A%D0%B5%D0%BA%D1%82\"><u>\u0411\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b<\/u><\/a>\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u043b\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430 \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0431\u044b\u043b\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u00ab\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u00bb, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u043a\u043b\u0430\u0441\u0441 User \u0438 \u0432 \u043d\u0435\u043c \u043f\u0438\u0441\u0430\u043b\u0430\u0441\u044c \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438. \u0411\u0435\u0437 \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0435\u0449\u0451 \u0444\u0430\u0439\u043b\u044b. \u0418 \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0433 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043f\u0435\u0440\u0432\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438 \u0441\u0442\u0430\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u043d\u043e \u043e\u043d\u0438 \u043d\u0435 \u0443\u0447\u0438\u043b\u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0418 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u043d\u043e\u0432\u043e\u043c\u043e\u0434\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432.<\/p>\n<h3>1. \u0412\u044b\u0445\u043e\u0434 \u0435\u0441\u0442\u044c<\/h3>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, Vue.js, React.js \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445. \u0422\u043e \u0435\u0441\u0442\u044c, \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0435\u0449\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043f\u0438\u0448\u0443\u0442 \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 \u0438 \u044d\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u0431\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043a\u0440\u0443\u043f\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439) \u043b\u043e\u0433\u0438\u043a\u0438, \u0442\u043e \u0432\u0441\u044f \u044d\u0442\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435. \u041f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430. \u0410 \u0435\u0441\u043b\u0438 \u0443\u0447\u0435\u0441\u0442\u044c \u0442\u043e, \u0447\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e Vue.js \u0435\u0449\u0435 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u044f \u043a\u0430\u043a computed, watch, mounted, created, \u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0438\u0448\u0443\u0442 \u0435\u0449\u0435 \u0438 \u0432\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u0412 \u0438\u0442\u043e\u0433\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0443\u044e \u0437\u0430 \u043a\u043b\u0438\u043a \u043f\u043e \u043a\u043d\u043e\u043f\u043a\u0435, \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043b\u0438\u0441\u0442\u0430\u0442\u044c \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u043e\u0432 js-\u043a\u043e\u0434\u0430, \u0431\u0435\u0433\u0430\u044f \u043c\u0435\u0436\u0434\u0443 methods, computed \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u0447\u0430\u0441\u0442\u044f\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 2008 \u0433\u043e\u0434\u0443, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a backend, \u0431\u044b\u043b\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0430 \u201c\u0441\u043b\u043e\u0438\u0441\u0442\u0430\u044f\u201d \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u044d\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0437\u043d\u0430\u044e\u0442 \u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u043e\u044f\u0445.<\/p>\n<p>\u0421 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c, \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0437\u043e\u043d\u044b \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u0434.<\/p>\n<p>\u0412\u043e\u0442 \u043e \u0442\u0430\u043a\u043e\u043c \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0441\u043b\u043e\u0438 \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c, \u043d\u043e \u0443\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a frontend-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a Vue.js, React.js \u0438 \u043f\u0440\u043e\u0447\u0438\u043c.&nbsp;<\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0435\u043e\u0440\u0438\u044f \u201c\u0441\u043b\u043e\u0438\u0441\u0442\u043e\u0439\u201d \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a backend, \u0438\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b. \u0418\u0434\u0435\u044f \u0436\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043d\u044f\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b \u043d\u0430 \u0441\u043b\u043e\u0438. \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<h2>2. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f  <\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435.  <\/p>\n<h4>2.1. \u041b\u043e\u0433\u0438\u043a\u0430 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043a\u043e\u043b\u043b\u0430\u0436\u0430\u043c\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435. \u0412 \u043d\u0435\u043c \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u043c\u043d\u043e\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<pre><code class=\"javascript\">methods: {     duplicateCollage (collage) {       this.$store.dispatch('updateCollage', { id: collage.id, isDuplicating: true })       dataService.duplicateCollage(collage, false)         .then(duplicate =&gt; {           this.$store.dispatch('updateCollage', { id: collage.id, isDuplicating: false })         })         .catch(() =&gt; {           this.$store.dispatch('updateCollage', { id: collage.id, isDuplicating: false })           this.$store.dispatch('errorsSet', { api: `We couldn't duplicate collage. Please, try again later.` })         })     },     deleteCollage (collage, index) {       this.$store.dispatch('updateCollage', { id: collage.id, isDeleting: true })       photosApi.deleteUserCollage(collage)         .then(() =&gt; {           this.$store.dispatch('updateCollage', {             id: collage.id,             isDeleting: false,             isDeleted: true           })           this.$store.dispatch('setUserCollages', { total: this.userCollages.total - 1 })           this.$store.dispatch('updateCollage', {             id: collage.id,             deletingTimer: setTimeout(() =&gt; {               this.$store.dispatch('updateCollage', { id: collage.id, deletingTimer: null })               this.$store.dispatch('setUserCollages', { items: this.userCollages.items.filter(userCollage =&gt; userCollage.id !== collage.id) })                 \/\/ If there is no one collages left - show templates               if (!this.$store.state.editor.userCollages.total) {                 this.currentTabName = this.TAB_TEMPLATES               }             }, 3000)           })         })     },     restoreCollage (collage) {       clearTimeout(collage.deletingTimer)       photosApi.saveUserCollage({ collage: { deleted: false } }, collage.id)         .then(() =&gt; {           this.$store.dispatch('updateCollage', {             id: collage.id,             deletingTimer: null,             isDeleted: false           })           this.$store.dispatch('setUserCollages', { total: this.userCollages.total + 1 })         })     } }<\/code><\/pre>\n<h4>2.2. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438<\/h4>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0437\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443.<\/p>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438 \u2013 \u044d\u0442\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u043b\u0438, \u043a\u0430\u043a \u0432 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u041a\u043e\u043b\u043b\u0430\u0436. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 services \u0438 \u0432 \u043d\u0435\u0439 \u2013 \u0444\u0430\u0439\u043b\u044b user.js \u0438 collage.js. \u0422\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2013 \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c\u044e, \u0431\u044b\u043b\u0430 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435.<\/p>\n<pre><code class=\"javascript\">services   |_collage.js   |_user.js<\/code><\/pre>\n<p>\u0412 \u0441\u0435\u0440\u0432\u0438\u0441 collage.js \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0430\u0436\u0435\u0439.  <\/p>\n<pre><code class=\"javascript\">export default class Collage {   static delete (collage) {     \/\/ \u041b\u041e\u0413\u0418\u041a\u0410 \u0423\u0414\u0410\u041b\u0415\u041d\u0418\u042f \u041a\u041e\u041b\u041b\u0410\u0416\u0410   }     static restore (collage) {     \/\/ \u041b\u041e\u0413\u0418\u041a\u0410 \u0412\u041e\u0421\u0421\u0422\u0410\u041d\u041e\u0412\u041b\u0415\u041d\u0418\u042f  \u041a\u041e\u041b\u041b\u0410\u0416\u0410   }     static duplicate (collage, changeUrl = true) {     \/\/ \u041b\u041e\u0413\u0418\u041a\u0410 \u0414\u0423\u0411\u041b\u0418\u0420\u041e\u0412\u0410\u041d\u0418\u042f \u041a\u041e\u041b\u041b\u0410\u0416\u0410   } }<\/code><\/pre>\n<h4>2.3. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435<\/h4>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043b\u0438\u0448\u044c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<pre><code class=\"javascript\">methods: {   duplicateCollage (collage) {     CollageService.duplicate(collage, false)   },   deleteCollage (collage) {     CollageService.delete(collage)   },   restoreCollage (collage) {     CollageService.restore(collage)   } }<\/code><\/pre>\n<p>\u0421 \u0442\u0430\u043a\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043a\u043e\u0434\u0430, \u0430 \u043b\u043e\u0433\u0438\u043a\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u043a\u043e\u043b\u043b\u0430\u0436\u0430\u043c\u0438, \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0444\u0430\u0439\u043b\u0435 collage.js, \u0430 \u043d\u0435 \u0440\u0430\u0437\u043c\u0430\u0437\u0430\u043d\u0430 \u043f\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u0434, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b. \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u043b\u044e\u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u0434 \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 \u043f\u0443\u0442\u0438 \u043a \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0432\u044b\u043d\u043e\u0441\u044f\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 API \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b (\u0444\u0430\u0439\u043b\u044b). \u042d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 API, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0443 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<pre><code class=\"javascript\">import axios from '@\/plugins\/axios'   export default class Api {     static login (email, password) {     return axios.post('auth\/login', { email, password })       .then(response =&gt; response.data)   }     static logout () {     return axios.post('auth\/logout')   }     static getCollages () {     return axios.get('\/collages')       .then(response =&gt; response.data)   }      static deleteCollage (collage) {     return axios.delete(`\/collage\/${collage.id}`)       .then(response =&gt; response.data)   }      static createCollage (collage) {     return axios.post(`\/collage\/${collage.id}`)       .then(response =&gt; response.data)   } }<\/code><\/pre>\n<h3>3. \u0427\u0442\u043e \u0438 \u043a\u0443\u0434\u0430 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c?<\/h3>\n<p>\u041d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u0447\u0442\u043e \u0436\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0438 \u043a\u0443\u0434\u0430 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c, \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u0442\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438: \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430, \u043b\u043e\u0433\u0438\u043a\u0430 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0411\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u2013 \u044d\u0442\u043e \u0432\u0441\u0435 \u0442\u043e, \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0422\u0417, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0434\u0438\u0437\u0430\u0439\u043d\u044b. \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>UserService.login()<\/em> \u0438\u043b\u0438 <em>ListService.sort()<\/em>. \u0414\u043b\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u2013 \u044d\u0442\u043e \u0442\u043e\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043a \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0435\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u043f\u043e\u0438\u0441\u043a \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. \u0414\u043b\u044f \u043b\u043e\u0433\u0438\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u043e\u0439 \u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0430\u043f\u043a\u0443 helpers \u0438 \u0432 \u043d\u0435\u0439 \u0444\u0430\u0439\u043b\u044b string.js, converter.js \u0438 \u043f\u0440\u043e\u0447\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u2013 \u0432\u0441\u0435 \u0442\u043e, \u0447\u0442\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c \u0438 \u0435\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 (methods, computed, watch \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435).<\/p>\n<pre><code class=\"javascript\">login (email, password) {   this.isLoading = true   userService.login(email, password)     .then(user =&gt; {       this.user = user       this.isLoading = false     }) }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u044d\u043b\u043f\u0435\u0440\u044b. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043d\u0430\u043c \u043b\u0435\u0433\u043a\u0438\u0435, \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0430 \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438\u043b\u0438 \u0445\u044d\u043b\u043f\u0435\u0440\u044b \u043d\u0430\u0447\u043d\u0443\u0442 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f, \u0442\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0435\u0441\u043b\u0438 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 3-5 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043f\u0430\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u043e \u0437\u0430\u043a\u0430\u0437\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0442\u043e<\/p>\n<\/div>\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-322827","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322827","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=322827"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322827\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}