add vue-mongotest vue js app component
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<container class="app">
|
||||
<h1>{{ title }}</h1>
|
||||
<Button text="Test Mongo" />
|
||||
</container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Button from './components/Button'
|
||||
export default {
|
||||
name: 'App',
|
||||
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: 'Hello World!'
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Button
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
task: []
|
||||
}
|
||||
}
|
||||
}
|
||||
</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>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<button @click="onClick()" class="btn">{{ text }}</button>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Button',
|
||||
props: {
|
||||
text: String,
|
||||
name: String
|
||||
},
|
||||
methods: {
|
||||
onClick() {
|
||||
console.log(this.text + ' button clicked')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,4 @@
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
|
||||
createApp(App).mount('#app')
|
||||
Reference in New Issue
Block a user