Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include copyright current year in vue.js? [closed]

How do I display current year in footer page like ©year in vue.js

Ex : ©2021 ©2020

following is the pure JavaScript version.

document.write(new Date().getFullYear())
like image 888
Khn Rzk Avatar asked Aug 18 '17 13:08

Khn Rzk


People also ask

How do I find out my current year VUE?

We can get the current year in vue by calling a getFullYear() method on a new Date() constructor. The getFullYear() method returns the year according to the user local time in four-digit(2020) format.

Is Vue JS free for commercial use?

Vue is a free and open source project released under the MIT License.

How do I add script tags to Vue?

Add a script tag inside your Vue component template. Just add the script into the component template. But don't forget to add, type="application/javascript" to the script tag otherwise it will show an error during the build.


1 Answers

Why not just use text interpolation?

new Vue({
  el: '#app',
});
<script src="https://unpkg.com/vue/dist/vue.min.js"></script>

<div id="app">
©{{ new Date().getFullYear() }}
</div>
like image 69
choasia Avatar answered Nov 11 '22 12:11

choasia