add vue-mongotest vue js app component
This commit is contained in:
+23
@@ -1 +1,24 @@
|
||||
.data/**
|
||||
.DS_Store
|
||||
node_modules
|
||||
dist
|
||||
/tmp
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
version: "3.9"
|
||||
version: "3.3"
|
||||
services:
|
||||
mongo:
|
||||
image: "mongo"
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- ./.data:/data
|
||||
- ./.mongo-data:/data
|
||||
|
||||
@@ -61,11 +61,16 @@ func main() {
|
||||
}
|
||||
return c.JSON(testitems)
|
||||
})
|
||||
app.Static("/", "dist")
|
||||
|
||||
app.Get("/", func(c *fiber.Ctx) error {
|
||||
|
||||
return c.SendString("<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title>Mongo Test</title></head><body><h1>Hello, World 👋!\n</h1><p><a href=\"/atest\">atest records</a></p></body></html>")
|
||||
app.Get("/*", func(ctx *fiber.Ctx) error {
|
||||
return ctx.SendFile("./dist/index.html")
|
||||
})
|
||||
|
||||
// app.Get("/", func(c *fiber.Ctx) error {
|
||||
|
||||
// return c.SendFile("<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title>Mongo Test</title></head><body><h1>Hello, World 👋!\n</h1><p><a href=\"/atest\">atest records</a></p></body></html>")
|
||||
// })
|
||||
|
||||
log.Fatal(app.Listen(":3000"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
||||
@@ -0,0 +1,17 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true
|
||||
},
|
||||
'extends': [
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended'
|
||||
],
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint'
|
||||
},
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
# mongodbtest
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
Generated
+29650
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "mongodbtest",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": "^3.6.5",
|
||||
"vue": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/compiler-sfc": "^3.0.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^7.0.0",
|
||||
"lint-staged": "^9.5.0"
|
||||
},
|
||||
"gitHooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,vue}": [
|
||||
"vue-cli-service lint",
|
||||
"git add"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -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