Last active
December 23, 2018 08:39
-
-
Save geekjourneyx/47ada4d08a60254da4d173bfa3ca2ca1 to your computer and use it in GitHub Desktop.
Vuejs Practice C2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="app"> | |
| <p v-if="show">2018 Merry Christmas</p> | |
| <a :href="url"> poros blog</a> | |
| <p>Today: {{ date | formateDate}}<p> | |
| <button @click="handleClose">Click</button> | |
| </div> | |
| <script> | |
| var app = mew Vue({ | |
| el: '#app', | |
| data: { | |
| show : true, | |
| url: 'https://reallyli.github.io', | |
| date: new Date() | |
| }, | |
| filters: { | |
| formateDate: function (value) { | |
| var date = new Date(vale) | |
| return date.getFullYear() + date.getMonth() | |
| } | |
| }, | |
| methods: { | |
| handleClose: function () { | |
| this.close() | |
| }, | |
| close: function () { | |
| this.show = false | |
| } | |
| } | |
| }) | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment