Skip to content

Commit

Permalink
Add some boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyFeliz committed Sep 18, 2020
1 parent a833c8b commit 8df3e01
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
],
"dependencies": {
"core-js": "^3.6.5",
"moment": "^2.28.0",
"vue": "^2.6.11"
},
"devDependencies": {
Expand Down Expand Up @@ -48,8 +49,7 @@
"license": "MIT",
"lint-staged": {
"*.{js,vue}": [
"vue-cli-service lint",
"git add"
"vue-cli-service lint"
]
},
"repository": {
Expand Down
17 changes: 3 additions & 14 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<template>
<div id="app">
<p v-if="countdown">The content will disapear in: {{ this.countdown }} secs</p>
<p v-else>The content is hidden</p>
<timed-content :from="from" :to="to" time-zone="America/Santo_Domingo">
<p>Some secret content</p>
</timed-content>
</div>
</template>

<script>
import moment from "moment";
import TimedContent from "./components/TimedContent.vue";
export default {
name: "app",
Expand All @@ -17,19 +16,9 @@ export default {
},
data() {
return {
from: new Date(),
to: new Date(),
countdown: 5
from: moment().add("seconds", 5).toDate(),
to: moment().add("seconds", 10).toDate()
};
},
created() {
this.to.setSeconds(this.to.getSeconds() + this.countdown);
const interval = setInterval(() => {
this.countdown--;
if (!this.countdown) {
clearInterval(interval);
}
}, 1000);
}
};
</script>
Expand Down

0 comments on commit 8df3e01

Please sign in to comment.