Kaynağa Gözat

代码提交

miaofuhao 3 yıl önce
ebeveyn
işleme
99ee17e04d
20 değiştirilmiş dosya ile 9323 ekleme ve 0 silme
  1. 4 0
      .browserslistrc
  2. 14 0
      .editorconfig
  3. 19 0
      .eslintrc.js
  4. 23 0
      .gitignore
  5. 9 0
      .prettierignore
  6. 8 0
      .prettierrc
  7. 27 0
      README.md
  8. 3 0
      babel.config.js
  9. 0 0
      ceshi.txt
  10. 8973 0
      package-lock.json
  11. 32 0
      package.json
  12. BIN
      public/favicon.ico
  13. 17 0
      public/index.html
  14. 27 0
      src/App.vue
  15. BIN
      src/assets/logo.png
  16. 124 0
      src/components/HelloWorld.vue
  17. 4 0
      src/main.ts
  18. 6 0
      src/shims-vue.d.ts
  19. 29 0
      tsconfig.json
  20. 4 0
      vue.config.js

+ 4 - 0
.browserslistrc

@@ -0,0 +1,4 @@
1
+> 1%
2
+last 2 versions
3
+not dead
4
+not ie 11

+ 14 - 0
.editorconfig

@@ -0,0 +1,14 @@
1
+# http://editorconfig.org
2
+root = true
3
+
4
+[*] # 表示所有文件适用
5
+charset = utf-8 # 设置文件字符集为 utf-8
6
+indent_style = space # 缩进风格(tab | space)
7
+indent_size = 2 # 缩进大小
8
+end_of_line = lf # 控制换行类型(lf | cr | crlf)
9
+trim_trailing_whitespace = true # 去除行首的任意空白字符
10
+insert_final_newline = true # 始终在文件末尾插入一个新行
11
+
12
+[*.md] # 表示仅 md 文件适用以下规则
13
+max_line_length = off
14
+trim_trailing_whitespace = false

+ 19 - 0
.eslintrc.js

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

+ 23 - 0
.gitignore

@@ -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?

+ 9 - 0
.prettierignore

@@ -0,0 +1,9 @@
1
+/dist/*
2
+.local
3
+.output.js
4
+/node_modules/**
5
+
6
+**/*.svg
7
+**/*.sh
8
+
9
+/public/*

+ 8 - 0
.prettierrc

@@ -0,0 +1,8 @@
1
+{
2
+  "useTabs": false,
3
+  "tabWidth": 2,
4
+  "printWidth": 80,
5
+  "singleQuote": true,
6
+  "trailingComma": "none",
7
+  "semi": false
8
+}

+ 27 - 0
README.md

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

+ 3 - 0
babel.config.js

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

+ 0 - 0
ceshi.txt


Dosya farkı çok büyük olduğundan ihmal edildi
+ 8973 - 0
package-lock.json


+ 32 - 0
package.json

@@ -0,0 +1,32 @@
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
+    "lint": "vue-cli-service lint",
9
+    "prettier": "prettier --write ."
10
+  },
11
+  "dependencies": {
12
+    "core-js": "^3.8.3",
13
+    "vue": "^3.2.13"
14
+  },
15
+  "devDependencies": {
16
+    "@typescript-eslint/eslint-plugin": "^5.4.0",
17
+    "@typescript-eslint/parser": "^5.4.0",
18
+    "@vue/cli-plugin-babel": "~5.0.0",
19
+    "@vue/cli-plugin-eslint": "~5.0.0",
20
+    "@vue/cli-plugin-typescript": "~5.0.0",
21
+    "@vue/cli-service": "~5.0.0",
22
+    "@vue/eslint-config-typescript": "^9.1.0",
23
+    "eslint": "^7.32.0",
24
+    "eslint-config-prettier": "^8.3.0",
25
+    "eslint-plugin-prettier": "^4.0.0",
26
+    "eslint-plugin-vue": "^8.0.3",
27
+    "less": "^4.0.0",
28
+    "less-loader": "^8.0.0",
29
+    "prettier": "^2.7.1",
30
+    "typescript": "~4.5.5"
31
+  }
32
+}

BIN
public/favicon.ico


+ 17 - 0
public/index.html

@@ -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>

+ 27 - 0
src/App.vue

@@ -0,0 +1,27 @@
1
+<template>
2
+  <img alt="Vue logo" src="./assets/logo.png" />
3
+  <HelloWorld msg="Welcome to Your Vue.js + TypeScript App" />
4
+</template>
5
+
6
+<script lang="ts">
7
+import { defineComponent } from 'vue'
8
+import HelloWorld from './components/HelloWorld.vue'
9
+
10
+export default defineComponent({
11
+  name: 'App',
12
+  components: {
13
+    HelloWorld
14
+  }
15
+})
16
+</script>
17
+
18
+<style lang="less">
19
+#app {
20
+  font-family: Avenir, Helvetica, Arial, sans-serif;
21
+  -webkit-font-smoothing: antialiased;
22
+  -moz-osx-font-smoothing: grayscale;
23
+  text-align: center;
24
+  color: #2c3e50;
25
+  margin-top: 60px;
26
+}
27
+</style>

BIN
src/assets/logo.png


+ 124 - 0
src/components/HelloWorld.vue

@@ -0,0 +1,124 @@
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"
8
+        >vue-cli documentation</a
9
+      >.
10
+    </p>
11
+    <h3>Installed CLI Plugins</h3>
12
+    <ul>
13
+      <li>
14
+        <a
15
+          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
16
+          target="_blank"
17
+          rel="noopener"
18
+          >babel</a
19
+        >
20
+      </li>
21
+      <li>
22
+        <a
23
+          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-typescript"
24
+          target="_blank"
25
+          rel="noopener"
26
+          >typescript</a
27
+        >
28
+      </li>
29
+      <li>
30
+        <a
31
+          href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
32
+          target="_blank"
33
+          rel="noopener"
34
+          >eslint</a
35
+        >
36
+      </li>
37
+    </ul>
38
+    <h3>Essential Links</h3>
39
+    <ul>
40
+      <li>
41
+        <a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a>
42
+      </li>
43
+      <li>
44
+        <a href="https://forum.vuejs.org" target="_blank" rel="noopener"
45
+          >Forum</a
46
+        >
47
+      </li>
48
+      <li>
49
+        <a href="https://chat.vuejs.org" target="_blank" rel="noopener"
50
+          >Community Chat</a
51
+        >
52
+      </li>
53
+      <li>
54
+        <a href="https://twitter.com/vuejs" target="_blank" rel="noopener"
55
+          >Twitter</a
56
+        >
57
+      </li>
58
+      <li>
59
+        <a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a>
60
+      </li>
61
+    </ul>
62
+    <h3>Ecosystem</h3>
63
+    <ul>
64
+      <li>
65
+        <a href="https://router.vuejs.org" target="_blank" rel="noopener"
66
+          >vue-router</a
67
+        >
68
+      </li>
69
+      <li>
70
+        <a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a>
71
+      </li>
72
+      <li>
73
+        <a
74
+          href="https://github.com/vuejs/vue-devtools#vue-devtools"
75
+          target="_blank"
76
+          rel="noopener"
77
+          >vue-devtools</a
78
+        >
79
+      </li>
80
+      <li>
81
+        <a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener"
82
+          >vue-loader</a
83
+        >
84
+      </li>
85
+      <li>
86
+        <a
87
+          href="https://github.com/vuejs/awesome-vue"
88
+          target="_blank"
89
+          rel="noopener"
90
+          >awesome-vue</a
91
+        >
92
+      </li>
93
+    </ul>
94
+  </div>
95
+</template>
96
+
97
+<script lang="ts">
98
+import { defineComponent } from 'vue'
99
+
100
+export default defineComponent({
101
+  name: 'HelloWorld',
102
+  props: {
103
+    msg: String
104
+  }
105
+})
106
+</script>
107
+
108
+<!-- Add "scoped" attribute to limit CSS to this component only -->
109
+<style scoped lang="less">
110
+h3 {
111
+  margin: 40px 0 0;
112
+}
113
+ul {
114
+  list-style-type: none;
115
+  padding: 0;
116
+}
117
+li {
118
+  display: inline-block;
119
+  margin: 0 10px;
120
+}
121
+a {
122
+  color: #42b983;
123
+}
124
+</style>

+ 4 - 0
src/main.ts

@@ -0,0 +1,4 @@
1
+import { createApp } from 'vue'
2
+import App from './App.vue'
3
+
4
+createApp(App).mount('#app')

+ 6 - 0
src/shims-vue.d.ts

@@ -0,0 +1,6 @@
1
+/* eslint-disable */
2
+declare module '*.vue' {
3
+  import type { DefineComponent } from 'vue'
4
+  const component: DefineComponent<{}, {}, any>
5
+  export default component
6
+}

+ 29 - 0
tsconfig.json

@@ -0,0 +1,29 @@
1
+{
2
+  "compilerOptions": {
3
+    "target": "esnext",
4
+    "module": "esnext",
5
+    "strict": true,
6
+    "jsx": "preserve",
7
+    "moduleResolution": "node",
8
+    "skipLibCheck": true,
9
+    "esModuleInterop": true,
10
+    "allowSyntheticDefaultImports": true,
11
+    "forceConsistentCasingInFileNames": true,
12
+    "useDefineForClassFields": true,
13
+    "sourceMap": true,
14
+    "baseUrl": ".",
15
+    "types": ["webpack-env"],
16
+    "paths": {
17
+      "@/*": ["src/*"]
18
+    },
19
+    "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
20
+  },
21
+  "include": [
22
+    "src/**/*.ts",
23
+    "src/**/*.tsx",
24
+    "src/**/*.vue",
25
+    "tests/**/*.ts",
26
+    "tests/**/*.tsx"
27
+  ],
28
+  "exclude": ["node_modules"]
29
+}

+ 4 - 0
vue.config.js

@@ -0,0 +1,4 @@
1
+const { defineConfig } = require('@vue/cli-service')
2
+module.exports = defineConfig({
3
+  transpileDependencies: true
4
+})