add basic view app

This commit is contained in:
2017-01-22 12:59:15 -07:00
parent f9e237da09
commit 540eda3ee3
7 changed files with 749 additions and 30 deletions

31
src/App.vue Normal file
View File

@@ -0,0 +1,31 @@
<template>
<div class="hello-world">
<h1>Welcome to Vue.js</h1>
<p>Counter: {{ count }}</p>
</div>
</template>
<script>
export default {
name: 'app',
data() {
return {
count: 0
};
},
mounted() {
this.interval = setInterval(() => {
this.count += 1;
}, 1000);
},
destroyed() {
clearInterval(this.interval);
}
}
</script>
<style>
body {
background-color: #eee;
}
</style>

View File

@@ -1,3 +1,6 @@
/* eslint-env browser */
import Vue from 'vue';
import App from './App.vue';
document.querySelector('#app').innerHTML = 'Hello, from main.js!';
new Vue({
render: h => h(App),
}).$mount('#app');