Browse Source

init

class
fugaosong 5 years ago
commit
032d876ed4
19 changed files with 11899 additions and 0 deletions
  1. 2
    0
      .browserslistrc
  2. 5
    0
      .editorconfig
  3. 17
    0
      .eslintrc.js
  4. 21
    0
      .gitignore
  5. 24
    0
      README.md
  6. 5
    0
      babel.config.js
  7. 11606
    0
      package-lock.json
  8. 28
    0
      package.json
  9. 5
    0
      postcss.config.js
  10. BIN
      public/favicon.ico
  11. 17
    0
      public/index.html
  12. 32
    0
      src/App.vue
  13. BIN
      src/assets/logo.png
  14. 60
    0
      src/components/HelloWorld.vue
  15. 12
    0
      src/main.js
  16. 27
    0
      src/router/index.js
  17. 15
    0
      src/store/index.js
  18. 5
    0
      src/views/About.vue
  19. 18
    0
      src/views/Home.vue

+ 2
- 0
.browserslistrc View File

@@ -0,0 +1,2 @@
1
+> 1%
2
+last 2 versions

+ 5
- 0
.editorconfig View File

@@ -0,0 +1,5 @@
1
+[*.{js,jsx,ts,tsx,vue}]
2
+indent_style = space
3
+indent_size = 2
4
+trim_trailing_whitespace = true
5
+insert_final_newline = true

+ 17
- 0
.eslintrc.js View File

@@ -0,0 +1,17 @@
1
+module.exports = {
2
+  root: true,
3
+  env: {
4
+    node: true
5
+  },
6
+  'extends': [
7
+    'plugin:vue/essential',
8
+    '@vue/standard'
9
+  ],
10
+  rules: {
11
+    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12
+    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
13
+  },
14
+  parserOptions: {
15
+    parser: 'babel-eslint'
16
+  }
17
+}

+ 21
- 0
.gitignore View File

@@ -0,0 +1,21 @@
1
+.DS_Store
2
+node_modules
3
+/dist
4
+
5
+# local env files
6
+.env.local
7
+.env.*.local
8
+
9
+# Log files
10
+npm-debug.log*
11
+yarn-debug.log*
12
+yarn-error.log*
13
+
14
+# Editor directories and files
15
+.idea
16
+.vscode
17
+*.suo
18
+*.ntvs*
19
+*.njsproj
20
+*.sln
21
+*.sw?

+ 24
- 0
README.md View File

@@ -0,0 +1,24 @@
1
+# sp
2
+
3
+## Project setup
4
+```
5
+npm install
6
+```
7
+
8
+### Compiles and hot-reloads for development
9
+```
10
+npm run serve
11
+```
12
+
13
+### Compiles and minifies for production
14
+```
15
+npm run build
16
+```
17
+
18
+### Lints and fixes files
19
+```
20
+npm run lint
21
+```
22
+
23
+### Customize configuration
24
+See [Configuration Reference](https://cli.vuejs.org/config/).

+ 5
- 0
babel.config.js View File

@@ -0,0 +1,5 @@
1
+module.exports = {
2
+  presets: [
3
+    '@vue/cli-plugin-babel/preset'
4
+  ]
5
+}

+ 11606
- 0
package-lock.json
File diff suppressed because it is too large
View File


+ 28
- 0
package.json View File

@@ -0,0 +1,28 @@
1
+{
2
+  "name": "sp",
3
+  "version": "0.1.0",
4
+  "private": true,
5
+  "scripts": {
6
+    "serve": "vue-cli-service serve",
7
+    "build": "vue-cli-service build",
8
+    "lint": "vue-cli-service lint"
9
+  },
10
+  "dependencies": {
11
+    "core-js": "^3.3.2",
12
+    "vue": "^2.6.10",
13
+    "vue-router": "^3.1.3",
14
+    "vuex": "^3.0.1"
15
+  },
16
+  "devDependencies": {
17
+    "@vue/cli-plugin-babel": "^4.0.0",
18
+    "@vue/cli-plugin-eslint": "^4.0.0",
19
+    "@vue/cli-plugin-router": "^4.0.0",
20
+    "@vue/cli-plugin-vuex": "^4.0.0",
21
+    "@vue/cli-service": "^4.0.0",
22
+    "@vue/eslint-config-standard": "^4.0.0",
23
+    "babel-eslint": "^10.0.3",
24
+    "eslint": "^5.16.0",
25
+    "eslint-plugin-vue": "^5.0.0",
26
+    "vue-template-compiler": "^2.6.10"
27
+  }
28
+}

+ 5
- 0
postcss.config.js View File

@@ -0,0 +1,5 @@
1
+module.exports = {
2
+  plugins: {
3
+    autoprefixer: {}
4
+  }
5
+}

BIN
public/favicon.ico View File


+ 17
- 0
public/index.html View File

@@ -0,0 +1,17 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
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>sp</title>
9
+  </head>
10
+  <body>
11
+    <noscript>
12
+      <strong>We're sorry but sp 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>

+ 32
- 0
src/App.vue View File

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

BIN
src/assets/logo.png View File


+ 60
- 0
src/components/HelloWorld.vue View File

@@ -0,0 +1,60 @@
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-router" target="_blank" rel="noopener">router</a></li>
13
+      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a></li>
14
+      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
15
+    </ul>
16
+    <h3>Essential Links</h3>
17
+    <ul>
18
+      <li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
19
+      <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
20
+      <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
21
+      <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
22
+      <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
23
+    </ul>
24
+    <h3>Ecosystem</h3>
25
+    <ul>
26
+      <li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
27
+      <li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
28
+      <li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
29
+      <li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
30
+      <li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
31
+    </ul>
32
+  </div>
33
+</template>
34
+
35
+<script>
36
+export default {
37
+  name: 'HelloWorld',
38
+  props: {
39
+    msg: String
40
+  }
41
+}
42
+</script>
43
+
44
+<!-- Add "scoped" attribute to limit CSS to this component only -->
45
+<style scoped>
46
+h3 {
47
+  margin: 40px 0 0;
48
+}
49
+ul {
50
+  list-style-type: none;
51
+  padding: 0;
52
+}
53
+li {
54
+  display: inline-block;
55
+  margin: 0 10px;
56
+}
57
+a {
58
+  color: #42b983;
59
+}
60
+</style>

+ 12
- 0
src/main.js View File

@@ -0,0 +1,12 @@
1
+import Vue from 'vue'
2
+import App from './App.vue'
3
+import router from './router'
4
+import store from './store'
5
+
6
+Vue.config.productionTip = false
7
+
8
+new Vue({
9
+  router,
10
+  store,
11
+  render: h => h(App)
12
+}).$mount('#app')

+ 27
- 0
src/router/index.js View File

@@ -0,0 +1,27 @@
1
+import Vue from 'vue'
2
+import VueRouter from 'vue-router'
3
+import Home from '../views/Home.vue'
4
+
5
+Vue.use(VueRouter)
6
+
7
+const routes = [
8
+  {
9
+    path: '/',
10
+    name: 'home',
11
+    component: Home
12
+  },
13
+  {
14
+    path: '/about',
15
+    name: 'about',
16
+    // route level code-splitting
17
+    // this generates a separate chunk (about.[hash].js) for this route
18
+    // which is lazy-loaded when the route is visited.
19
+    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
20
+  }
21
+]
22
+
23
+const router = new VueRouter({
24
+  routes
25
+})
26
+
27
+export default router

+ 15
- 0
src/store/index.js View File

@@ -0,0 +1,15 @@
1
+import Vue from 'vue'
2
+import Vuex from 'vuex'
3
+
4
+Vue.use(Vuex)
5
+
6
+export default new Vuex.Store({
7
+  state: {
8
+  },
9
+  mutations: {
10
+  },
11
+  actions: {
12
+  },
13
+  modules: {
14
+  }
15
+})

+ 5
- 0
src/views/About.vue View File

@@ -0,0 +1,5 @@
1
+<template>
2
+  <div class="about">
3
+    <h1>This is an about page</h1>
4
+  </div>
5
+</template>

+ 18
- 0
src/views/Home.vue View File

@@ -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: 'home',
14
+  components: {
15
+    HelloWorld
16
+  }
17
+}
18
+</script>

Loading…
Cancel
Save