{"id":372297,"date":"2024-05-21T05:08:48","date_gmt":"2024-05-21T05:08:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=372297"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=372297","title":{"rendered":"<span>SFC Vue3 \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0432 Bitrix, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Composition API, \u0431\u0435\u0437 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u0432, \u0431\u0435\u0437 CDN \u0438 NPM \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 Vue + Bitrix, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 \u044d\u0442\u043e\u043c \u0432\u0438\u0434\u0435\u043e, \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/66056f68315cc3d4a1efc657\" data-style=\"\" id=\"66056f68315cc3d4a1efc657\" width=\"\"><\/div>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0437\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e, \u043d\u043e \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u0443\u0436\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u043b\u0438:<\/p>\n<blockquote>\n<p>&#171;\u0414\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0432 \u0437\u0430\u0447\u0430\u0442\u043e\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435&#187;<\/p>\n<\/blockquote>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0434\u0430, \u044f \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d, \u0431\u0435\u0437 Bitrix CLI \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0443\u0434\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 SPA, \u0434\u0430 \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u0443 \u044d\u0442\u043e \u043d\u0430\u0434\u043e? \u042d\u0442\u043e \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0443\u0449\u0438\u0439 \u0430\u0434 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e Frontend \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041f\u0440\u043e\u0449\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Bitrix \u043a\u0430\u043a API, \u043d\u043e \u043d\u0435 \u0441\u0443\u0442\u044c.<\/p>\n<p>\u042f \u043d\u0430\u0448\u0435\u043b \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u0435\u0437 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 SFC Vue \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u0442\u043e \u0442\u043e \u0443\u0436\u0435 \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u043b. \u041d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044f \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u0442\u043e \u0442\u0430\u043a \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b).<\/p>\n<p>\u041e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u0431\u0435\u0437 CDN, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Vue, \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e:<\/p>\n<ol>\n<li>\n<p>\u041e\u043d \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u044f\u0434\u0440\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 extension, \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c Vuex\/Pinia, \u043d\u043e \u0442\u0443\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<\/li>\n<\/ol>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043e\u0431\u0435\u0440\u0443 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0438\u0434\u0431\u044d\u043a\u0430, \u0442\u043e \u0441\u0434\u0435\u043b\u0430\u044e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430 \u0434\u0430\u043d\u043d\u0443\u044e \u0442\u0435\u043c\u0443.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c Vue \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<pre><code class=\"php\">&lt;?Bitrix\\Main\\UI\\Extension::load(\"ui.vue3\");<\/code><\/pre>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0432 \u043a\u0443\u0440\u0441\u0435, Composition API \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 3 \u0432\u0435\u0440\u0441\u0438\u0438 Vue. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Vue3.<\/p>\n<p>Vue 3 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043a\u043e\u0433\u0434\u0430 Bitrix \u043f\u0435\u0440\u0435\u0448\u0435\u043b \u043d\u0430 8 \u0432\u0435\u0440\u0441\u0438\u044e PHP (\u043c\u043e\u0433\u0443 \u043e\u0448\u0438\u0431\u0430\u0442\u044c\u0441\u044f), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f!<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438 Vue &#8212; \u0434\u0430\u043b\u0435\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442.<\/p>\n<h2>P.S.<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0438 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Vue. \u0422\u043e\u043b\u044c\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u043e Composition \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u043e\u0435 API. \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u043c\u043e\u0433\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0440\u043e\u0433\u043e API \u0435\u0441\u043b\u0438 \u0441\u043e\u0431\u0435\u0440\u0443 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0438\u0434\u0431\u044d\u043a.<\/p>\n<hr\/>\n<h2>SCRIPT.JS<\/h2>\n<pre><code class=\"javascript\">\/** This function is called when the DOM is ready. *\/ BX.ready(() => {     \/**      * Returns an element by its ID      * @param {string} id - The ID of the element to be returned      * @returns {HTMLElement} The element with the specified ID, or null if no element with the specified ID exists      *\/     const node = BX('app')     const application = BX.Vue3.createApp({       \/**        * This function is a lifecycle hook that is called when the component is first created.        * It sets up the component's state by returning an object that contains the component's data.        * @returns {object} An object containing the component's data        *\/       setup() {         \/**          * Returns a reactive reference to a value.          * @param {any} value - The value to be referenced          * @returns {import('vue').Ref&lt;any>} A reactive reference to the value          *\/         const counter = BX.Vue3.ref(0);          setInterval(() => {           counter.value++;         }, 300);          return {           counter,         };       },     });     \/**      * Mounts the Vue 3 application instance to the DOM element.      * @param {HTMLElement|String} node - The DOM element to mount Vue 3 application instance      *\/     application.mount(node); })<\/code><\/pre>\n<p>\u0422\u0435 \u043a\u0442\u043e \u0432\u0438\u0434\u0435\u043b \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u043b\u0438 \u0432\u0438\u0434\u0435\u043e \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u0435 \u0438\u043b\u0438 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 Vue \u0437\u043d\u0430\u044e\u0442 \u0447\u0442\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e createApp \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0438 \u043d\u0430\u0448\u0435\u0439 \u0432\u0435\u0440\u0441\u0442\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 JS, \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0451 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439. \u041f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0442\u043a\u0443 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 Vue \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0438 \u0443\u0434\u043e\u0431\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e template \u0441 \u0432\u0435\u0440\u0441\u0442\u043a\u043e\u0439 \u0438 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 . \u041d\u0430\u0448 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 template.php<\/p>\n<hr\/>\n<h2>TEMPLATE.PHP<\/h2>\n<pre><code class=\"php\">&lt;div id=\"app\">     {{ counter }} &lt;\/div><\/code><\/pre>\n<p>\u0414\u0430 \u0432\u0441\u0435 \u0432\u0435\u0440\u043d\u043e, \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0432 template.php \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0432\u043e Vue \u0444\u0430\u0439\u043b\u0435. \u041d\u0443 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 style.css \u043f\u0438\u0448\u0435\u043c \u0441\u0442\u0438\u043b\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442\u0441\u044f.<\/p>\n<p>\u0423\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e: <\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0432\u0435\u043b\u0438 \u0432\u0435\u0440\u0441\u0442\u043a\u0443 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 Vue \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<li>\n<p>JS \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0445\u0440\u0430\u043d\u0438\u043c \u0432 JS.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0438\u043b\u0438 \u0445\u0440\u0430\u043d\u0438\u043c \u0432 style.css.<\/p>\n<\/li>\n<\/ol>\n<p>\u0418 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043d\u0430 Vue \u0432 Bitrix \u0440\u0435\u0448\u0435\u043d\u0430. \u041f\u0443\u0441\u043a\u0430\u0439 \u0445\u043e\u0442\u044c \u0438 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0430.<\/p>\n<p>\u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044f \u0441\u043a\u0430\u0436\u0443 \u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u0435\u0435.<\/p>\n<hr\/>\n<h2>\u0415\u0449\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u0435\u0435&#8230;<\/h2>\n<p>100% \u0432\u0441\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0447\u0442\u043e \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044a\u0435\u043a\u0442 BX.Vue3 \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e. \u0418 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c.<\/p>\n<p>\u041d\u0443 \u0447\u0442\u043e-\u0436 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0442\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Vue \u0432\u0435\u0437\u0434\u0435, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0435\u0433\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e. \u0423\u0441\u043b\u043e\u0432\u043d\u043e \u0432 header.php<\/p>\n<pre><code class=\"php\">&lt;?Bitrix\\Main\\UI\\Extension::load(\"ui.vue3\");<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u043e\u0431\u044a\u0435\u043a\u0442 BX.Vue3 \u0435\u0441\u0442\u044c \u0432\u0435\u0437\u0434\u0435, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e. \u0418 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435.<\/p>\n<pre><code class=\"javascript\">for (const key in BX.Vue3) window[key] = BX.Vue3[key]<\/code><\/pre>\n<p>\u0414\u0430 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 BX.Vue3 \u0432 window, \u0438 \u043d\u0430\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d &#171;\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439&#187; \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441.<\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 script.js<\/p>\n<pre><code class=\"javascript\">BX.ready(() => {     const node = BX('app')     const application = createApp({       setup() {         const counter = ref(0);          setInterval(() => {           counter.value++;         }, 300);          return {           counter,         };       },     });     application.mount(node); })<\/code><\/pre>\n<p>\u041d\u0443 \u0432\u043e\u0442, \u044d\u0442\u043e \u0443\u0436\u0435 \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u044d\u0442\u043e \u043f\u043b\u043e\u0445\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0412\u0435\u0434\u044c \u043c\u044b \u0437\u0430\u0441\u043e\u0440\u044f\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 window. \u041d\u043e \u043a\u0430\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b &#8212; \u0441\u043e\u0439\u0434\u0435\u0442. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 window BX.Vue3, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u0443\u0436\u0435 \u0432\u044b\u043d\u0435\u0441\u043b\u0438.<\/p>\n<p>\u041d\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043f\u0440\u043e\u0441\u044f\u0442. \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u043c\u0435\u043d\u044f Vue \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0432\u0435\u0437\u0434\u0435, \u0438 \u044f \u043d\u0435 \u0445\u043e\u0447\u0443 \u0437\u0430\u0441\u043e\u0440\u044f\u0442\u044c window, \u043d\u043e \u0445\u043e\u0447\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Vue \u0431\u0435\u0437 BX.Vue3?<\/p>\n<p>\u0422\u0430\u043a \u0432\u043e\u0442 (\u043a\u0442\u043e-\u0442\u043e \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0441\u044f) \u0438 \u0442\u0443\u0442 \u0432\u044b\u0445\u043e\u0434 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c, \u0438 \u043f\u0440\u0438\u0447\u0435\u043c \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439.<\/p>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e.<\/p>\n<pre><code class=\"javascript\">const { ref, createApp } = BX.Vue3<\/code><\/pre>\n<p>\u0418 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 window<\/p>\n<p>\u0418 \u0434\u0430 \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0434\u043b\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0438 \u0432\u0430\u0448\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 window.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/p>\n<pre><code class=\"javascript\">BX.ready(() => {     const { ref, createApp } = BX.Vue3     const node = BX('app')     const application = createApp({       setup() {         const counter = ref(0);          setInterval(() => {           counter.value++;         }, 300);          return {           counter,         };       },     });     application.mount(node); })<\/code><\/pre>\n<p>\u041e\u043a\u0435\u0439, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0432\u0435\u0449\u0430\u043c \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u0421\u0432\u044f\u0437\u043a\u0430 front + back.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u0430 \u043a\u0430\u043a \u043d\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0431\u044d\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u0432 component.php.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442. \u041d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u0442.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432 template.php \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0433 script \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434.<\/p>\n<pre><code class=\"javascript\">const arResult = &lt;?=Bitrix\\Main\\Web\\Json::encode($arResult)?><\/code><\/pre>\n<p>\u0438\u043b\u0438 \u0436\u0435 \u0432\u043e\u0442 \u0442\u0430\u043a, \u043a\u043e\u043c\u0443 \u043a\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u043c\u043d\u0435 \u043b\u0438\u0447\u043d\u043e \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431.<\/p>\n<pre><code class=\"javascript\">const arResult = &lt;?=json_encode($arResult, true)?><\/code><\/pre>\n<p>\u041b\u0438\u0431\u043e \u0434\u043b\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0435\u0434\u043e\u0432 \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434, \u043d\u043e \u043a\u0430\u043a \u043f\u043e \u043c\u043d\u0435 \u043e\u043d \u0443\u0436\u0435 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c.<\/p>\n<pre><code class=\"php\">&lt;?CUtil::PhpToJSObject<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c BX.message, \u043d\u043e \u043a\u0430\u043a \u043f\u043e \u043c\u043d\u0435 \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0447\u0442\u043e \u043b\u0438&#8230;<\/p>\n<hr\/>\n<h2>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u044b\u0439 \u043a\u0440\u0443\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0411\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e NEXT GEN<\/h2>\n<p>\u0420\u0430\u0437 \u043c\u044b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0442.\u043a. \u043a\u0430\u043a \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 Vue &#8212; \u043d\u0435\u0442. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0442 component.php, \u043a class.php<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u044f\u043c \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u0440\u0443\u0442\u043e \u0431\u044b\u043b\u043e.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441 \u043d\u0443\u043b\u044f \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u043f\u0438\u0448\u0435\u043c \u0435\u0433\u043e \u043d\u0430 class.php, \u0438 \u0434\u0435\u043b\u0430\u0435\u043c +- \u0447\u0442\u043e \u0442\u043e \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0447\u0435\u043c \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u044b.<\/p>\n<h2>TEMPLATE.PHP<\/h2>\n<pre><code class=\"xml\">&lt;ul id=\"users-list\" class=\"users-list\">     &lt;li v-for=\"(user, key) in arResult.users\" class=\"users-list__item\" :key=\"key\">         {{ user }}         &lt;button type=\"button\" @click=\"deleteUser(user.id)\">\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f&lt;\/button>     &lt;\/li>     &lt;form @submit=\"addUser\" class=\"form\">         &lt;div class=\"form__field\">             &lt;label>\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f&lt;\/label>             &lt;input type=\"text\" name=\"name\">         &lt;\/div>         &lt;button type=\"submit\">\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f&lt;\/button>     &lt;\/form> &lt;\/ul><\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430\u0448 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442, \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 Vue, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0438\u043b\u0435\u0439 \u0432 style.css, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c \u0447\u0442\u043e \u0441\u0442\u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442.<\/p>\n<pre><code class=\"css\">.users-list {     padding: 12px; } .users-list__item {     padding: 12px;     background-color: #e2e2e2;     border-radius: 4px;     margin-bottom: 8px; }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u043a\u0438 \u0432 class.php \u0438 scirpt.js<\/p>\n<h2>CLASS.PHP<\/h2>\n<pre><code class=\"php\">&lt;?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true)     die();  use Bitrix\\Main\\UI\\Extension,     Bitrix\\Main\\Engine\\Contract\\Controllerable;  Extension::load(\"ui.vue3\"); class UsersList extends CBitrixComponent implements Controllerable {     protected static array $users = [         [             'id' => 1,             'name' => 'Alexander',         ],         [             'id' => 2,             'name' => 'Ivan',         ],         [             'id' => 3,             'name' => 'Sergey',         ],         [             'id' => 4,             'name' => 'Smith',         ],         [             'id' => 5,             'name' => 'John'         ],     ];     public function configureActions(): array     {         return [];     }      public function deleteUserAction($id): array     {         foreach (self::$users as $key => $user) {             if ($user['id'] == $id) {                 unset(self::$users[$key]);                 break;             }         }         return self::$users;     }      public function getUsersAction(): array     {         return self::$users;     }      public function addUserAction(): array     {         $lastUser = end(self::$users);         $newUser = [             'id' => $lastUser['id'] + 1,             'name' => $_POST['name'],         ];         self::$users[] = $newUser;         return self::$users;     }      public function executeComponent(): void     {         $this->includeComponentTemplate();     } }<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043d\u0430\u0448 Vue, \u0434\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e CBitrixComponent \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u0431\u044b\u043b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0438 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u0447\u0435\u0440\u0435\u0437 BX.ajax.runComponentAction, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<h2>SCRIPT.JS<\/h2>\n<pre><code class=\"javascript\">const { runComponentAction } = BX.ajax; const { ref, createApp, reactive } = BX.Vue3; BX.ready(() => {   createApp({     setup() {       function deleteUser(id) {         const request = runComponentAction(\"test:test\", \"deleteUser\", {           mode: \"class\",           data: { id: id },         });         request.then((reponse) => arResult.users = reponse.data);       }        function addUser(e) {         e.preventDefault();         const request = runComponentAction(\"test:test\", \"addUser\", {           mode: \"class\",           data: new FormData(e.target),         });         request.then((reponse) => arResult.users = reponse.data);       };        const arResult = reactive({});       const request = runComponentAction(\"test:test\", \"getUsers\", {         mode: \"class\",       });       request.then((reponse) => (arResult.users = reponse.data));        return {         arResult,         addUser,         deleteUser       };     },   }).mount(\"#users-list\"); });<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0442\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u0431\u0435\u0440\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430\u0448\u0435 Vue \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043d\u0438\u043c\u0438.<\/p>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 arResult \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043d\u0430\u0448\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0432 template.php.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d30\/6f9\/6cf\/d306f96cfb5b96ddf5ffb68d28efded4.png\" alt=\"\u0412\u043e\u0442 \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.\" title=\"\u0412\u043e\u0442 \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.\" width=\"1854\" height=\"360\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d30\/6f9\/6cf\/d306f96cfb5b96ddf5ffb68d28efded4.png\"\/><\/p>\n<div><figcaption>\u0412\u043e\u0442 \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0436\u0438\u043c\u0430\u044f \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043e\u043d \u0443\u0434\u0430\u043b\u0438\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0435\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f. \u0422\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0437\u0430 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u0437 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043c\u044b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u0438\u043b\u0438 (\u043d\u0443 \u043a\u0430\u043a \u0431\u044b \u0438\u0437 \u043a\u043e\u0434\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u043e).<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0443\u0439\u043c\u0443 \u043a\u0430\u043a \u0441 \u044d\u0442\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e.<\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c VueDev Tools \u043e\u043d\u0438 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>SFC \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c, \u0434\u043e SPA \u0432\u0440\u044f\u0434 \u043b\u0438 \u0442\u0430\u043a\u0438\u043c\u0438 \u0442\u0435\u043c\u043f\u0430\u043c\u0438 \u0434\u043e\u0439\u0434\u0435\u043c, \u043d\u0443\u0436\u043d\u043e \u0436\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e, \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Bitrix \u043a\u0430\u043a API \u0438 \u043d\u0435 \u043f\u0430\u0440\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043d\u0435\u0442, \u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0442\u0430\u043a \u0438 \u043f\u043b\u043e\u0445.<\/p>\n<p><strong>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/strong><\/p>\n<ol>\n<li>\n<p>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c package.json, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c node \u0438 node_modules \u0432 Bitrix, \u0432\u0441\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e &#171;\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438&#187; \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c Bitrix CLI \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 extension \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 Vue \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0435\u0440\u0441\u0442\u043a\u0430 template \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0432 JS, \u0435\u0451 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 \u0441\u0435\u0440\u0432\u0435\u0440, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0442\u043e \u0442\u0435\u043a\u0441\u0442 \u0442\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u0431\u043e\u0442\u043e\u043c \u043a\u0430\u043a \u043f\u0443\u0441\u0442\u0430\u044f. \u0425\u043e\u0442\u044f \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0433\u0443\u0433\u043b\u0430 \u0438 \u044f\u043d\u0434\u0435\u043a\u0441\u0430 \u0443\u043c\u0435\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 \u0443\u0436\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Composition API, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f API + \u043a\u043e\u0434\u0430 \u0441\u0442\u0430\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435, \u0438 \u043e\u043d \u0441\u0442\u0430\u043b \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<\/strong><\/p>\n<ol>\n<li>\n<p>\u0412\u0440\u044f\u0434 \u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0435 SPA \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. (\u041d\u0443 \u0432\u0435\u0440\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u043d\u0435 \u0437\u0430\u0445\u043e\u0447\u0435\u0448\u044c)<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u0430\u043a \u043f\u043e \u043c\u043d\u0435 \u0432\u044b\u0448\u043b\u043e \u043d\u0435 \u043f\u043b\u043e\u0445\u043e, \u0438 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0430, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u0441\u0432\u043e\u0439 \u0444\u0438\u0434\u0431\u044d\u043a. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/804165\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0411\u044b\u043b\u0430 \u043b\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">87.5% <\/span><span class=\"tm-article-poll__answer-label\">\u0414\u0430<\/span><span class=\"tm-article-poll__answer-votes\">7<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 87.5%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">12.5% <\/span><span class=\"tm-article-poll__answer-label\">\u041d\u0435\u0442<\/span><span class=\"tm-article-poll__answer-votes\">1<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 12.5%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 8 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0441\u044f 1 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. <\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/804165\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0411\u0443\u0434\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">40% <\/span><span class=\"tm-article-poll__answer-label\">\u0414\u0430<\/span><span class=\"tm-article-poll__answer-votes\">4<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 40%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">30% <\/span><span class=\"tm-article-poll__answer-label\">\u041d\u0435\u0442<\/span><span class=\"tm-article-poll__answer-votes\">3<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 30%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">30% <\/span><span class=\"tm-article-poll__answer-label\">\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/span><span class=\"tm-article-poll__answer-votes\">3<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 30%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 10 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0441\u044f 1 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/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\/articles\/804165\/\"> https:\/\/habr.com\/ru\/articles\/804165\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 Vue + Bitrix, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 \u044d\u0442\u043e\u043c \u0432\u0438\u0434\u0435\u043e, \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/66056f68315cc3d4a1efc657\" data-style=\"\" id=\"66056f68315cc3d4a1efc657\" width=\"\"><\/div>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0437\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e, \u043d\u043e \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u0443\u0436\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u043b\u0438:<\/p>\n<blockquote>\n<p>&#171;\u0414\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0432 \u0437\u0430\u0447\u0430\u0442\u043e\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435&#187;<\/p>\n<\/blockquote>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0434\u0430, \u044f \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d, \u0431\u0435\u0437 Bitrix CLI \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0443\u0434\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 SPA, \u0434\u0430 \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u0443 \u044d\u0442\u043e \u043d\u0430\u0434\u043e? \u042d\u0442\u043e \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0443\u0449\u0438\u0439 \u0430\u0434 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e Frontend \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041f\u0440\u043e\u0449\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Bitrix \u043a\u0430\u043a API, \u043d\u043e \u043d\u0435 \u0441\u0443\u0442\u044c.<\/p>\n<p>\u042f \u043d\u0430\u0448\u0435\u043b \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u0435\u0437 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 SFC Vue \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u0442\u043e \u0442\u043e \u0443\u0436\u0435 \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u043b. \u041d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044f \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u0442\u043e \u0442\u0430\u043a \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b).<\/p>\n<p>\u041e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u0431\u0435\u0437 CDN, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 Vue, \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e:<\/p>\n<ol>\n<li>\n<p>\u041e\u043d \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u044f\u0434\u0440\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 extension, \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c Vuex\/Pinia, \u043d\u043e \u0442\u0443\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<\/li>\n<\/ol>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043e\u0431\u0435\u0440\u0443 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0438\u0434\u0431\u044d\u043a\u0430, \u0442\u043e \u0441\u0434\u0435\u043b\u0430\u044e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430 \u0434\u0430\u043d\u043d\u0443\u044e \u0442\u0435\u043c\u0443.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c Vue \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<pre><code class=\"php\">&lt;?Bitrix\\Main\\UI\\Extension::load(\"ui.vue3\");<\/code><\/pre>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u0432 \u043a\u0443\u0440\u0441\u0435, Composition API \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 3 \u0432\u0435\u0440\u0441\u0438\u0438 Vue. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Vue3.<\/p>\n<p>Vue 3 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043a\u043e\u0433\u0434\u0430 Bitrix \u043f\u0435\u0440\u0435\u0448\u0435\u043b \u043d\u0430 8 \u0432\u0435\u0440\u0441\u0438\u044e PHP (\u043c\u043e\u0433\u0443 \u043e\u0448\u0438\u0431\u0430\u0442\u044c\u0441\u044f), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f!<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438 Vue &#8212; \u0434\u0430\u043b\u0435\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442.<\/p>\n<h2>P.S.<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0438 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Vue. \u0422\u043e\u043b\u044c\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u043e Composition \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u043e\u0435 API. \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u043c\u043e\u0433\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0440\u043e\u0433\u043e API \u0435\u0441\u043b\u0438 \u0441\u043e\u0431\u0435\u0440\u0443 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0438\u0434\u0431\u044d\u043a.<\/p>\n<hr\/>\n<h2>SCRIPT.JS<\/h2>\n<pre><code class=\"javascript\">\/** This function is called when the DOM is ready. *\/ BX.ready(() => {     \/**      * Returns an element by its ID      * @param {string} id - The ID of the element to be returned      * @returns {HTMLElement} The element with the specified ID, or null if no element with the specified ID exists      *\/     const node = BX('app')     const application = BX.Vue3.createApp({       \/**        * This function is a lifecycle hook that is called when the component is first created.        * It sets up the component's state by returning an object that contains the component's data.        * @returns {object} An object containing the component's data        *\/       setup() {         \/**          * Returns a reactive reference to a value.          * @param {any} value - The value to be referenced          * @returns {import('vue').Ref&lt;any>} A reactive reference to the value          *\/         const counter = BX.Vue3.ref(0);          setInterval(() => {           counter.value++;         }, 300);          return {           counter,         };       },     });     \/**      * Mounts the Vue 3 application instance to the DOM element.      * @param {HTMLElement|String} node - The DOM element to mount Vue 3 application instance      *\/     application.mount(node); })<\/code><\/pre>\n<p>\u0422\u0435 \u043a\u0442\u043e \u0432\u0438\u0434\u0435\u043b \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u043b\u0438 \u0432\u0438\u0434\u0435\u043e \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u0435 \u0438\u043b\u0438 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 Vue \u0437\u043d\u0430\u044e\u0442 \u0447\u0442\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e createApp \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0438 \u043d\u0430\u0448\u0435\u0439 \u0432\u0435\u0440\u0441\u0442\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 JS, \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0451 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439. \u041f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0442\u043a\u0443 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 Vue \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0438 \u0443\u0434\u043e\u0431\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e template \u0441 \u0432\u0435\u0440\u0441\u0442\u043a\u043e\u0439 \u0438 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 . \u041d\u0430\u0448 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 template.php<\/p>\n<hr\/>\n<h2>TEMPLATE.PHP<\/h2>\n<pre><code class=\"php\">&lt;div id=\"app\">     {{ counter }} &lt;\/div><\/code><\/pre>\n<p>\u0414\u0430 \u0432\u0441\u0435 \u0432\u0435\u0440\u043d\u043e, \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0432 template.php \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0432\u043e Vue \u0444\u0430\u0439\u043b\u0435. \u041d\u0443 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 style.css \u043f\u0438\u0448\u0435\u043c \u0441\u0442\u0438\u043b\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442\u0441\u044f.<\/p>\n<p>\u0423\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e: <\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0432\u0435\u043b\u0438 \u0432\u0435\u0440\u0441\u0442\u043a\u0443 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 Vue \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<li>\n<p>JS \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0445\u0440\u0430\u043d\u0438\u043c \u0432 JS.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0438\u043b\u0438 \u0445\u0440\u0430\u043d\u0438\u043c \u0432 style.css.<\/p>\n<\/li>\n<\/ol>\n<p>\u0418 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043d\u0430 Vue \u0432 Bitrix \u0440\u0435\u0448\u0435\u043d\u0430. \u041f\u0443\u0441\u043a\u0430\u0439 \u0445\u043e\u0442\u044c \u0438 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0430.<\/p>\n<p>\u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044f \u0441\u043a\u0430\u0436\u0443 \u0438 \u0434\u0430\u0436\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u0435\u0435.<\/p>\n<hr\/>\n<h2>\u0415\u0449\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u0435\u0435&#8230;<\/h2>\n<p>100% \u0432\u0441\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0447\u0442\u043e \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044a\u0435\u043a\u0442 BX.Vue3 \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e. \u0418 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c.<\/p>\n<p>\u041d\u0443 \u0447\u0442\u043e-\u0436 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0442\u044c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Vue \u0432\u0435\u0437\u0434\u0435, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0435\u0433\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e. \u0423\u0441\u043b\u043e\u0432\u043d\u043e \u0432 header.php<\/p>\n<pre><code class=\"php\">&lt;?Bitrix\\Main\\UI\\Extension::load(\"ui.vue3\");<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u043e\u0431\u044a\u0435\u043a\u0442 BX.Vue3 \u0435\u0441\u0442\u044c \u0432\u0435\u0437\u0434\u0435, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e. \u0418 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435.<\/p>\n<pre><code class=\"javascript\">for (const key in BX.Vue3) window[key] = BX.Vue3[key]<\/code><\/pre>\n<p>\u0414\u0430 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 BX.Vue3 \u0432 window, \u0438 \u043d\u0430\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d &#171;\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439&#187; \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441.<\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 script.js<\/p>\n<pre><code class=\"javascript\">BX.ready(() => {     const node = BX('app')     const application = createApp({       setup() {         const counter = ref(0);          setInterval(() => {           counter.value++;         }, 300);          return {           counter,         };       },     });     application.mount(node); })<\/code><\/pre>\n<p>\u041d\u0443 \u0432\u043e\u0442, \u044d\u0442\u043e \u0443\u0436\u0435 \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u044d\u0442\u043e \u043f\u043b\u043e\u0445\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0412\u0435\u0434\u044c \u043c\u044b \u0437\u0430\u0441\u043e\u0440\u044f\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 window. \u041d\u043e \u043a\u0430\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b &#8212; \u0441\u043e\u0439\u0434\u0435\u0442. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u0437 window BX.Vue3, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u0443\u0436\u0435 \u0432\u044b\u043d\u0435\u0441\u043b\u0438.<\/p>\n<p>\u041d\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043f\u0440\u043e\u0441\u044f\u0442. \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u043c\u0435\u043d\u044f Vue \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0432\u0435\u0437\u0434\u0435, \u0438 \u044f \u043d\u0435 \u0445\u043e\u0447\u0443 \u0437\u0430\u0441\u043e\u0440\u044f\u0442\u044c window, \u043d\u043e \u0445\u043e\u0447\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Vue \u0431\u0435\u0437 BX.Vue3?<\/p>\n<p>\u0422\u0430\u043a \u0432\u043e\u0442 (\u043a\u0442\u043e-\u0442\u043e \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0441\u044f) \u0438 \u0442\u0443\u0442 \u0432\u044b\u0445\u043e\u0434 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c, \u0438 \u043f\u0440\u0438\u0447\u0435\u043c \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439.<\/p>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e.<\/p>\n<pre><code class=\"javascript\">const { ref, createApp } = BX.Vue3<\/code><\/pre>\n<p>\u0418 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435 \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 window<\/p>\n<p>\u0418 \u0434\u0430 \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0434\u043b\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0438 \u0432\u0430\u0448\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 window.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/p>\n<pre><code class=\"javascript\">BX.ready(() => {     const { ref, createApp } = BX.Vue3     const node = BX('app')     const application = createApp({       setup() {         const counter = ref(0);          setInterval(() => {           counter.value++;         }, 300);          return {           counter,         };       },     });     application.mount(node); })<\/code><\/pre>\n<p>\u041e\u043a\u0435\u0439, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0432\u0435\u0449\u0430\u043c \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u0421\u0432\u044f\u0437\u043a\u0430 front + back.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u0430 \u043a\u0430\u043a \u043d\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0431\u044d\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u0432 component.php.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442. \u041d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u0442.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432 template.php \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0433 script \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434.<\/p>\n<pre><code class=\"javascript\">const arResult = &lt;?=Bitrix\\Main\\Web\\Json::encode($arResult)?><\/code><\/pre>\n<p>\u0438\u043b\u0438 \u0436\u0435 \u0432\u043e\u0442 \u0442\u0430\u043a, \u043a\u043e\u043c\u0443 \u043a\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u043c\u043d\u0435 \u043b\u0438\u0447\u043d\u043e \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431.<\/p>\n<pre><code class=\"javascript\">const arResult = &lt;?=json_encode($arResult, true)?><\/code><\/pre>\n<p>\u041b\u0438\u0431\u043e \u0434\u043b\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0435\u0434\u043e\u0432 \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434, \u043d\u043e \u043a\u0430\u043a \u043f\u043e \u043c\u043d\u0435 \u043e\u043d \u0443\u0436\u0435 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c.<\/p>\n<pre><code class=\"php\">&lt;?CUtil::PhpToJSObject<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c BX.message, \u043d\u043e \u043a\u0430\u043a \u043f\u043e \u043c\u043d\u0435 \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0447\u0442\u043e \u043b\u0438&#8230;<\/p>\n<hr\/>\n<h2>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u044b\u0439 \u043a\u0440\u0443\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0411\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e NEXT GEN<\/h2>\n<p>\u0420\u0430\u0437 \u043c\u044b \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0442.\u043a. \u043a\u0430\u043a \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 Vue &#8212; \u043d\u0435\u0442. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0442 component.php, \u043a class.php<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u044f\u043c \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u0440\u0443\u0442\u043e \u0431\u044b\u043b\u043e.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441 \u043d\u0443\u043b\u044f \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u043f\u0438\u0448\u0435\u043c \u0435\u0433\u043e \u043d\u0430 class.php, \u0438 \u0434\u0435\u043b\u0430\u0435\u043c +- \u0447\u0442\u043e \u0442\u043e \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0447\u0435\u043c \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u044b.<\/p>\n<h2>TEMPLATE.PHP<\/h2>\n<pre><code class=\"xml\">&lt;ul id=\"users-list\" class=\"users-list\">     &lt;li v-for=\"(user, key) in arResult.users\" class=\"users-list__item\" :key=\"key\">         {{ user }}         &lt;button type=\"button\" @click=\"deleteUser(user.id)\">\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f&lt;\/button>     &lt;\/li>     &lt;form @submit=\"addUser\" class=\"form\">         &lt;div class=\"form__field\">             &lt;label>\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f&lt;\/label>             &lt;input type=\"text\" name=\"name\">         &lt;\/div>         &lt;button type=\"submit\">\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f&lt;\/button>     &lt;\/form> &lt;\/ul><\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430\u0448 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442, \u0441 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 Vue, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0438\u043b\u0435\u0439 \u0432 style.css, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c \u0447\u0442\u043e \u0441\u0442\u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442.<\/p>\n<pre><code class=\"css\">.users-list {     padding: 12px; } .users-list__item {     padding: 12px;     background-color: #e2e2e2;     border-radius: 4px;     margin-bottom: 8px; }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443. \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0438\u043a\u0438 \u0432 class.php \u0438 scirpt.js<\/p>\n<h2>CLASS.PHP<\/h2>\n<pre><code class=\"php\">&lt;?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true)     die();  use Bitrix\\Main\\UI\\Extension,     Bitrix\\Main\\Engine\\Contract\\Controllerable;  Extension::load(\"ui.vue3\"); class UsersList extends CBitrixComponent implements Controllerable {     protected static array $users = [         [             'id' => 1,             'name' => 'Alexander',         ],         [             'id' => 2,             'name' => 'Ivan',         ],         [             'id' => 3,             'name' => 'Sergey',         ],         [             'id' => 4,             'name' => 'Smith',         ],         [             'id' => 5,             'name' => 'John'         ],     ];     public function configureActions(): array     {         return [];     }      public function deleteUserAction($id): array     {         foreach (self::$users as $key => $user) {             if ($user['id'] == $id) {                 unset(self::$users[$key]);                 break;             }         }         return self::$users;     }      public function getUsersAction(): array     {         return self::$users;     }      public function addUserAction(): array     {         $lastUser = end(self::$users);         $newUser = [             'id' => $lastUser['id'] + 1,             'name' => $_POST['name'],         ];         self::$users[] = $newUser;         return self::$users;     }      public function executeComponent(): void     {         $this->includeComponentTemplate();     } }<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043d\u0430\u0448 Vue, \u0434\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e CBitrixComponent \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u0431\u044b\u043b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0438 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u0447\u0435\u0440\u0435\u0437 BX.ajax.runComponentAction, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<h2>SCRIPT.JS<\/h2>\n<pre><code class=\"javascript\">const { runComponentAction } = BX.ajax; const { ref, createApp, reactive } = BX.Vue3; BX.ready(() => {   createApp({     setup() {       function deleteUser(id) {         const request = runComponentAction(\"test:test\", \"deleteUser\", {           mode: \"class\",           data: { id: id },         });         request.then((reponse) =><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\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-372297","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/372297","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=372297"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/372297\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=372297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=372297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=372297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}