- app.vue
<template>
<div id="app">
<img width="25%" src="./assets/logo.png">
<Countdown :date="end" @onFinish="finish()"></Countdown>
<HelloWorld/>
</div>
</template>
<script>
import Countdown from './components/Countdown';
import HelloWorld from "./components/HelloWorld";
export default {
name: "App",
components: {
HelloWorld,
Countdown
},
data () {
return {
end: new Date('2019-05-02T16:37:00')
};
},
methods: {
finish() {
console.log('finish');
}
}
};
</script>
<style>
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
- main
import Vue from "vue";
import App from "./App";
Vue.config.productionTip = false;
/* eslint-disable no-new */
new Vue({
el: "#app",
components: { App },
template: "<App/>"
});