Skip to content

Commit

Permalink
answer: task 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Anastasia th9 authored and Anastasia th9 committed Dec 17, 2024
1 parent 05c3122 commit 1cfd797
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 01-basics/10-create-app/script.js
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
import { defineComponent, createApp } from 'vue'

const Comp = defineComponent({
name: 'CurrentDate',
setup() {
function formatAsLocalDate(date) {
return new Date(date).toLocaleDateString(undefined, { dateStyle: 'long' });
}

const currentDate = new Date();

return {
formatAsLocalDate,
currentDate
};
},
template: `<div>Сегодня {{ formatAsLocalDate(currentDate) }}</div>`
});


createApp(Comp).mount("#app");

0 comments on commit 1cfd797

Please sign in to comment.