From b126ae0d4ff603a9be7641bc967dad226e10648b Mon Sep 17 00:00:00 2001 From: Kira Date: Thu, 19 Dec 2024 15:42:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=B0=20=D1=81=20=D1=81=D0=B5=D0=B3=D0=BE=D0=B4=D0=BD=D1=8F?= =?UTF-8?q?=D1=88=D0=BD=D0=B5=D0=B9=20=D0=B4=D0=B0=D1=82=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01-basics/10-create-app/index.html | 2 +- 01-basics/10-create-app/script.js | 33 +++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/01-basics/10-create-app/index.html b/01-basics/10-create-app/index.html index cf7b57d..939119f 100644 --- a/01-basics/10-create-app/index.html +++ b/01-basics/10-create-app/index.html @@ -8,4 +8,4 @@
- + \ No newline at end of file diff --git a/01-basics/10-create-app/script.js b/01-basics/10-create-app/script.js index 40fac68..83aa2bc 100644 --- a/01-basics/10-create-app/script.js +++ b/01-basics/10-create-app/script.js @@ -1 +1,32 @@ -import { defineComponent, createApp } from 'vue' +import { defineComponent, createApp } from 'vue'; + +const App = defineComponent({ + name: 'App', + + setup() { + function formattedData() { + const date = new Date(); + + const options = { + dateStyle: 'long', + }; + + return date.toLocaleDateString(navigator.language, options); + } + + const DATE = formattedData(); + + return { + formattedData, + DATE, + } + }, + + template: ` +
Сегодня {{ DATE }}
+ ` +}) + +const app = createApp(App); +const vm = app.mount('#app'); +window.vm = vm; \ No newline at end of file