Skip to content

Instantly share code, notes, and snippets.

@geekjourneyx
Last active December 23, 2018 08:39
Show Gist options
  • Select an option

  • Save geekjourneyx/47ada4d08a60254da4d173bfa3ca2ca1 to your computer and use it in GitHub Desktop.

Select an option

Save geekjourneyx/47ada4d08a60254da4d173bfa3ca2ca1 to your computer and use it in GitHub Desktop.
Vuejs Practice C2
<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