Skip to content

Commit f07c8af

Browse files
committed
init
0 parents  commit f07c8af

39 files changed

+9213
-0
lines changed

.browserslistrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
> 1%
2+
last 2 versions
3+
not dead
4+
not ie 11

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[*.{js,jsx,ts,tsx,vue}]
2+
indent_style = space
3+
indent_size = 2
4+
end_of_line = lf
5+
trim_trailing_whitespace = true
6+
insert_final_newline = true
7+
max_line_length = 100

.eslintrc.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
},
6+
extends: [
7+
'plugin:vue/vue3-essential',
8+
'@vue/airbnb',
9+
],
10+
parserOptions: {
11+
parser: '@babel/eslint-parser',
12+
},
13+
rules: {
14+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
15+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
16+
},
17+
overrides: [
18+
{
19+
files: [
20+
'**/__tests__/*.{j,t}s?(x)',
21+
'**/tests/unit/**/*.spec.{j,t}s?(x)',
22+
],
23+
env: {
24+
jest: true,
25+
},
26+
},
27+
],
28+
};

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
6+
# local env files
7+
.env.local
8+
.env.*.local
9+
10+
# Log files
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# Editor directories and files
17+
.idea
18+
.vscode
19+
*.suo
20+
*.ntvs*
21+
*.njsproj
22+
*.sln
23+
*.sw?

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# vue3_admin
2+
3+
## Project setup
4+
```
5+
yarn install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
yarn serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
yarn build
16+
```
17+
18+
### Run your unit tests
19+
```
20+
yarn test:unit
21+
```
22+
23+
### Lints and fixes files
24+
```
25+
yarn lint
26+
```
27+
28+
### Customize configuration
29+
See [Configuration Reference](https://cli.vuejs.org/config/).

babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset',
4+
],
5+
};

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
preset: '@vue/cli-plugin-unit-jest',
3+
};

jsconfig.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "esnext",
5+
"baseUrl": "./",
6+
"moduleResolution": "node",
7+
"paths": {
8+
"@/*": [
9+
"src/*"
10+
]
11+
},
12+
"lib": [
13+
"esnext",
14+
"dom",
15+
"dom.iterable",
16+
"scripthost"
17+
]
18+
}
19+
}

package.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "vue3_admin",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"test:unit": "vue-cli-service test:unit",
9+
"lint": "vue-cli-service lint"
10+
},
11+
"dependencies": {
12+
"core-js": "^3.8.3",
13+
"register-service-worker": "^1.7.2",
14+
"vue": "^3.2.13",
15+
"vue-router": "^4.0.3",
16+
"vuex": "^4.0.0"
17+
},
18+
"devDependencies": {
19+
"@babel/core": "^7.12.16",
20+
"@babel/eslint-parser": "^7.12.16",
21+
"@vue/cli-plugin-babel": "~5.0.0",
22+
"@vue/cli-plugin-eslint": "~5.0.0",
23+
"@vue/cli-plugin-pwa": "~5.0.0",
24+
"@vue/cli-plugin-router": "~5.0.0",
25+
"@vue/cli-plugin-unit-jest": "~5.0.0",
26+
"@vue/cli-plugin-vuex": "~5.0.0",
27+
"@vue/cli-service": "~5.0.0",
28+
"@vue/eslint-config-airbnb": "^6.0.0",
29+
"@vue/test-utils": "^2.0.0-0",
30+
"@vue/vue3-jest": "^27.0.0-alpha.1",
31+
"babel-jest": "^27.0.6",
32+
"eslint": "^7.32.0",
33+
"eslint-plugin-import": "^2.25.3",
34+
"eslint-plugin-vue": "^8.0.3",
35+
"eslint-plugin-vuejs-accessibility": "^1.1.0",
36+
"jest": "^27.0.5",
37+
"less": "^4.0.0",
38+
"less-loader": "^8.0.0"
39+
}
40+
}

public/favicon.ico

4.19 KB
Binary file not shown.
9.2 KB
Loading
29.1 KB
Loading
Loading
Loading
3.29 KB
Loading
3.95 KB
Loading
4.57 KB
Loading
1.46 KB
Loading
1.78 KB
Loading

public/img/icons/apple-touch-icon.png

4.57 KB
Loading

public/img/icons/favicon-16x16.png

799 Bytes
Loading

public/img/icons/favicon-32x32.png

1.24 KB
Loading
1.14 KB
Loading

public/img/icons/mstile-150x150.png

4.18 KB
Loading
Lines changed: 3 additions & 0 deletions
Loading

public/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title><%= htmlWebpackPlugin.options.title %></title>
9+
</head>
10+
<body>
11+
<noscript>
12+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13+
</noscript>
14+
<div id="app"></div>
15+
<!-- built files will be auto injected -->
16+
</body>
17+
</html>

public/robots.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Disallow:

src/App.vue

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<template>
2+
<nav>
3+
<router-link to="/">Home</router-link> |
4+
<router-link to="/about">About</router-link>
5+
</nav>
6+
<router-view/>
7+
</template>
8+
9+
<style lang="less">
10+
#app {
11+
font-family: Avenir, Helvetica, Arial, sans-serif;
12+
-webkit-font-smoothing: antialiased;
13+
-moz-osx-font-smoothing: grayscale;
14+
text-align: center;
15+
color: #2c3e50;
16+
}
17+
18+
nav {
19+
padding: 30px;
20+
21+
a {
22+
font-weight: bold;
23+
color: #2c3e50;
24+
25+
&.router-link-exact-active {
26+
color: #42b983;
27+
}
28+
}
29+
}
30+
</style>

src/assets/logo.png

6.69 KB
Loading

src/components/HelloWorld.vue

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<template>
2+
<div class="hello">
3+
<h1>{{ msg }}</h1>
4+
<p>
5+
For a guide and recipes on how to configure / customize this project,<br>
6+
check out the
7+
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
8+
</p>
9+
<h3>Installed CLI Plugins</h3>
10+
<ul>
11+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
12+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa" target="_blank" rel="noopener">pwa</a></li>
13+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
14+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a></li>
15+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
16+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-jest" target="_blank" rel="noopener">unit-jest</a></li>
17+
</ul>
18+
<h3>Essential Links</h3>
19+
<ul>
20+
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
21+
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
22+
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
23+
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
24+
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
25+
</ul>
26+
<h3>Ecosystem</h3>
27+
<ul>
28+
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
29+
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
30+
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
31+
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
32+
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
33+
</ul>
34+
</div>
35+
</template>
36+
37+
<script>
38+
export default {
39+
name: 'HelloWorld',
40+
props: {
41+
msg: String,
42+
},
43+
};
44+
</script>
45+
46+
<!-- Add "scoped" attribute to limit CSS to this component only -->
47+
<style scoped lang="less">
48+
h3 {
49+
margin: 40px 0 0;
50+
}
51+
ul {
52+
list-style-type: none;
53+
padding: 0;
54+
}
55+
li {
56+
display: inline-block;
57+
margin: 0 10px;
58+
}
59+
a {
60+
color: #42b983;
61+
}
62+
</style>

src/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createApp } from 'vue';
2+
import App from './App.vue';
3+
import './registerServiceWorker';
4+
import router from './router';
5+
import store from './store';
6+
7+
createApp(App).use(store).use(router).mount('#app');

src/registerServiceWorker.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* eslint-disable no-console */
2+
3+
import { register } from 'register-service-worker';
4+
5+
if (process.env.NODE_ENV === 'production') {
6+
register(`${process.env.BASE_URL}service-worker.js`, {
7+
ready() {
8+
console.log(
9+
'App is being served from cache by a service worker.\n'
10+
+ 'For more details, visit https://goo.gl/AFskqB',
11+
);
12+
},
13+
registered() {
14+
console.log('Service worker has been registered.');
15+
},
16+
cached() {
17+
console.log('Content has been cached for offline use.');
18+
},
19+
updatefound() {
20+
console.log('New content is downloading.');
21+
},
22+
updated() {
23+
console.log('New content is available; please refresh.');
24+
},
25+
offline() {
26+
console.log('No internet connection found. App is running in offline mode.');
27+
},
28+
error(error) {
29+
console.error('Error during service worker registration:', error);
30+
},
31+
});
32+
}

src/router/index.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { createRouter, createWebHashHistory } from 'vue-router';
2+
import HomeView from '../views/HomeView.vue';
3+
4+
const routes = [
5+
{
6+
path: '/',
7+
name: 'home',
8+
component: HomeView,
9+
},
10+
{
11+
path: '/about',
12+
name: 'about',
13+
// route level code-splitting
14+
// this generates a separate chunk (about.[hash].js) for this route
15+
// which is lazy-loaded when the route is visited.
16+
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue'),
17+
},
18+
];
19+
20+
const router = createRouter({
21+
history: createWebHashHistory(),
22+
routes,
23+
});
24+
25+
export default router;

src/store/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { createStore } from 'vuex';
2+
3+
export default createStore({
4+
state: {
5+
},
6+
getters: {
7+
},
8+
mutations: {
9+
},
10+
actions: {
11+
},
12+
modules: {
13+
},
14+
});

src/views/AboutView.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div class="about">
3+
<h1>This is an about page</h1>
4+
</div>
5+
</template>

src/views/HomeView.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div class="home">
3+
<img alt="Vue logo" src="../assets/logo.png">
4+
<HelloWorld msg="Welcome to Your Vue.js App"/>
5+
</div>
6+
</template>
7+
8+
<script>
9+
// @ is an alias to /src
10+
import HelloWorld from '@/components/HelloWorld.vue';
11+
12+
export default {
13+
name: 'HomeView',
14+
components: {
15+
HelloWorld,
16+
},
17+
};
18+
</script>

0 commit comments

Comments
 (0)