Skip to content

Commit 95284e5

Browse files
陈鑫陈鑫
authored andcommitted
项目搭建
0 parents  commit 95284e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3827
-0
lines changed

.eslintrc.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
module.exports = {
2+
parser: 'vue-eslint-parser',
3+
parserOptions: {
4+
parser: '@typescript-eslint/parser',
5+
ecmaVersion: 2020,
6+
sourceType: 'module',
7+
ecmaFeatures: {
8+
jsx: true,
9+
},
10+
},
11+
extends: [
12+
'plugin:vue/vue3-recommended',
13+
'plugin:@typescript-eslint/recommended',
14+
'prettier/@typescript-eslint',
15+
'plugin:prettier/recommended',
16+
],
17+
rules: {
18+
'@typescript-eslint/ban-ts-ignore': 'off',
19+
'@typescript-eslint/explicit-function-return-type': 'off',
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
'@typescript-eslint/no-var-requires': 'off',
22+
'@typescript-eslint/no-empty-function': 'off',
23+
'vue/custom-event-name-casing': 'off',
24+
'no-use-before-define': 'off',
25+
'@typescript-eslint/no-use-before-define': 'off',
26+
'@typescript-eslint/ban-ts-comment': 'off',
27+
'@typescript-eslint/ban-types': 'off',
28+
'@typescript-eslint/no-non-null-assertion': 'off',
29+
'@typescript-eslint/explicit-module-boundary-types': 'off',
30+
'@typescript-eslint/no-unused-vars': [
31+
'error',
32+
{
33+
argsIgnorePattern: '^h$',
34+
varsIgnorePattern: '^h$',
35+
},
36+
],
37+
'no-unused-vars': [
38+
'error',
39+
{
40+
argsIgnorePattern: '^h$',
41+
varsIgnorePattern: '^h$',
42+
},
43+
],
44+
'space-before-function-paren': 'off',
45+
quotes: ['error', 'single'],
46+
'comma-dangle': ['error', 'never'],
47+
},
48+
};

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"arrowParens": "always",
5+
"trailingComma": "all"
6+
}

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Vue 3 + Typescript + Vite
2+
3+
This template should help get you started developing with Vue 3 and Typescript in Vite.
4+
5+
## Recommended IDE Setup
6+
7+
[VSCode](https://code.visualstudio.com/) + [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur). Make sure to enable `vetur.experimental.templateInterpolationService` in settings!
8+
9+
### If Using `<script setup>`
10+
11+
[`<script setup>`](https://github.com/vuejs/rfcs/pull/227) is a feature that is currently in RFC stage. To get proper IDE support for the syntax, use [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) instead of Vetur (and disable Vetur).
12+
13+
## Type Support For `.vue` Imports in TS
14+
15+
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can use the following:
16+
17+
### If Using Volar
18+
19+
Run `Volar: Switch TS Plugin on/off` from VSCode command palette.
20+
21+
### If Using Vetur
22+
23+
1. Install and add `@vuedx/typescript-plugin-vue` to the [plugins section](https://www.typescriptlang.org/tsconfig#plugins) in `tsconfig.json`
24+
2. Delete `src/shims-vue.d.ts` as it is no longer needed to provide module info to Typescript
25+
3. Open `src/main.ts` in VSCode
26+
4. Open the VSCode command palette
27+
5. Search and run "Select TypeScript version" -> "Use workspace version"

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "0.0.0",
3+
"scripts": {
4+
"dev": "vite",
5+
"build": "vue-tsc --noEmit && vite build",
6+
"serve": "vite preview"
7+
},
8+
"dependencies": {
9+
"ant-design-vue": "2.2.2",
10+
"axios": "^0.21.1",
11+
"crypto-js": "^4.0.0",
12+
"qs": "^6.10.1",
13+
"spark-md5": "^3.0.1",
14+
"vue": "^3.0.5",
15+
"vue-router": "^4.0.9",
16+
"vuex": "^4.0.1"
17+
},
18+
"devDependencies": {
19+
"@types/node": "^16.4.3",
20+
"@typescript-eslint/parser": "^4.27.0",
21+
"@vitejs/plugin-vue": "^1.2.3",
22+
"@vitejs/plugin-vue-jsx": "^1.1.3",
23+
"@vue/compiler-sfc": "^3.0.5",
24+
"eslint": "^7.28.0",
25+
"eslint-config-prettier": "^8.3.0",
26+
"eslint-plugin-prettier": "^3.4.0",
27+
"eslint-plugin-vue": "^7.11.1",
28+
"less": "^4.1.1",
29+
"less-loader": "^10.0.0",
30+
"prettier": "^2.3.1",
31+
"typescript": "^4.3.2",
32+
"vite": "^2.3.7",
33+
"vite-plugin-style-import": "^1.0.1",
34+
"vue-tsc": "^0.0.24"
35+
}
36+
}

public/favicon.ico

4.19 KB
Binary file not shown.

src/App.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineComponent } from 'vue'
2+
import { RouterView } from 'vue-router'
3+
4+
export default defineComponent({
5+
name: 'App',
6+
components: { RouterView },
7+
setup() {
8+
return () => <router-view />
9+
},
10+
})

src/api/user.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import service from '@/utils/fetch';
2+
import qs from 'qs'
3+
4+
// 用户登录
5+
export const login = (params: any): any => service({
6+
method: 'post',
7+
url: '/sys/login',
8+
data: params,
9+
});

src/assets/logo.png

6.69 KB
Loading

0 commit comments

Comments
 (0)