10 changed files with 107 additions and 73 deletions
@ -1,17 +1,39 @@ |
|||||
module.exports = { |
module.exports = { |
||||
root: true, |
env: { |
||||
parserOptions: { |
browser: true, |
||||
sourceType: "module" |
es2021: true, |
||||
|
node: true |
||||
|
}, |
||||
|
extends: [ |
||||
|
'plugin:vue/essential', |
||||
|
'standard', |
||||
|
'plugin:vue/vue3-recommended' |
||||
|
], |
||||
|
parserOptions: { |
||||
|
ecmaVersion: 'latest', |
||||
|
parser: '@typescript-eslint/parser', |
||||
|
sourceType: 'module', |
||||
|
ecmaFeatures: { |
||||
|
modules: true |
||||
}, |
}, |
||||
parser: "vue-eslint-parser", |
requireConfigFile: false |
||||
extends: ["plugin:vue/vue3-essential","plugin:vue/vue3-strongly-recommended","plugin:vue/vue3-recommended"], |
}, |
||||
env: { |
plugins: [ |
||||
browser: true, |
'vue', |
||||
node: true, |
'@typescript-eslint' |
||||
es6: true |
], |
||||
}, |
rules: { |
||||
rules: { |
semi: [2, 'never'], // 禁止尾部使用分号“ ; ”
|
||||
'no-console': 'off', |
'no-var': 'error', // 禁止使用 var
|
||||
'comma-dangle': [2,'never'] |
indent: ['error', 2], // 缩进2格
|
||||
} |
'no-mixed-spaces-and-tabs': 'error', // 不能空格与tab混用
|
||||
} |
quotes: [2, 'single'], // 使用单引号
|
||||
|
'vue/html-closing-bracket-newline': 'off', // 不强制换行
|
||||
|
'vue/singleline-html-element-content-newline': 'off', // 不强制换行
|
||||
|
'vue/max-attributes-per-line': ['error', { |
||||
|
singleline: { max: 5 }, |
||||
|
multiline: { max: 5 } |
||||
|
}] // vue template模板元素第一行最多5个属性
|
||||
|
// 其它的规则可以去eslint查看,根据自己需要进行添加
|
||||
|
} |
||||
|
} |
||||
|
@ -1,9 +1,8 @@ |
|||||
import { createApp } from 'vue' |
import { createApp } from 'vue' |
||||
import App from '@/App.vue' |
import App from '@/App.vue' |
||||
|
|
||||
// @ts-ignore
|
|
||||
import router from '@/router/index' |
import router from '@/router/index' |
||||
// @ts-ignore
|
|
||||
import {store,key} from '@/store/index' |
|
||||
|
|
||||
createApp(App).use(router).use(store,key).mount('#app') |
import { store, key } from '@/store/index' |
||||
|
|
||||
|
createApp(App).use(router).use(store, key).mount('#app') |
||||
|
@ -1,24 +1,24 @@ |
|||||
import {createRouter, createWebHashHistory, RouteRecord, RouteRecordRaw} from 'vue-router' |
import { createRouter, createWebHashHistory, RouteRecord, RouteRecordRaw } from 'vue-router' |
||||
|
|
||||
import Home from '../views/tst/Home.vue' |
import Home from '../views/tst/Home.vue' |
||||
|
|
||||
const routes: Array<RouteRecordRaw> = |
const routes: Array<RouteRecordRaw> = |
||||
[ |
[ |
||||
{ |
{ |
||||
path: '/', |
path: '/', |
||||
name: 'Home', |
name: 'Home', |
||||
component: Home |
component: Home |
||||
}, |
}, |
||||
{ |
{ |
||||
path: '/about', |
path: '/about', |
||||
name: 'About', |
name: 'About', |
||||
component: () => import('../views/tst/About.vue') |
component: () => import('../views/tst/About.vue') |
||||
} |
} |
||||
] |
] |
||||
|
|
||||
const router = createRouter({ |
const router = createRouter({ |
||||
history: createWebHashHistory(), |
history: createWebHashHistory(), |
||||
routes |
routes |
||||
}) |
}) |
||||
|
|
||||
export default router |
export default router |
||||
|
@ -1,18 +1,18 @@ |
|||||
import axios from "axios" |
import axios from 'axios' |
||||
|
|
||||
const service = axios.create({ |
const service = axios.create({ |
||||
baseURL: 'http://127.0.0.1:8888', |
baseURL: 'http://127.0.0.1:8888', |
||||
timeout: 10000 |
timeout: 10000 |
||||
}) |
}) |
||||
|
|
||||
service.interceptors.request.use(config => { |
service.interceptors.request.use(config => { |
||||
return config |
return config |
||||
}) |
}) |
||||
|
|
||||
service.interceptors.response.use(response => { |
service.interceptors.response.use(response => { |
||||
return response |
return response |
||||
},error => { |
}, error => { |
||||
return Promise.reject(error) |
return Promise.reject(error) |
||||
}) |
}) |
||||
|
|
||||
export default service |
export default service |
||||
|
@ -1,14 +1,13 @@ |
|||||
<template> |
<template> |
||||
<div>{{name}}</div> |
<div>{{ name }}</div> |
||||
</template> |
</template> |
||||
|
|
||||
|
|
||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||
import {ref} from 'vue' |
import { ref } from 'vue' |
||||
|
|
||||
const name = ref('this is home') |
const name = ref('this is home') |
||||
</script> |
</script> |
||||
|
|
||||
<style scoped> |
<style scoped> |
||||
|
|
||||
</style> |
</style> |
||||
|
Loading…
Reference in new issue