add basic view app
This commit is contained in:
31
src/App.vue
Normal file
31
src/App.vue
Normal 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>
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user