nelson
3 years ago
10 changed files with 107 additions and 73 deletions
@ -1,17 +1,39 @@ |
|||
module.exports = { |
|||
root: true, |
|||
parserOptions: { |
|||
sourceType: "module" |
|||
env: { |
|||
browser: true, |
|||
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", |
|||
extends: ["plugin:vue/vue3-essential","plugin:vue/vue3-strongly-recommended","plugin:vue/vue3-recommended"], |
|||
env: { |
|||
browser: true, |
|||
node: true, |
|||
es6: true |
|||
}, |
|||
rules: { |
|||
'no-console': 'off', |
|||
'comma-dangle': [2,'never'] |
|||
} |
|||
} |
|||
requireConfigFile: false |
|||
}, |
|||
plugins: [ |
|||
'vue', |
|||
'@typescript-eslint' |
|||
], |
|||
rules: { |
|||
semi: [2, 'never'], // 禁止尾部使用分号“ ; ”
|
|||
'no-var': 'error', // 禁止使用 var
|
|||
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 App from '@/App.vue' |
|||
|
|||
// @ts-ignore
|
|||
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' |
|||
|
|||
const routes: Array<RouteRecordRaw> = |
|||
[ |
|||
{ |
|||
path: '/', |
|||
name: 'Home', |
|||
component: Home |
|||
}, |
|||
{ |
|||
path: '/about', |
|||
name: 'About', |
|||
component: () => import('../views/tst/About.vue') |
|||
} |
|||
{ |
|||
path: '/', |
|||
name: 'Home', |
|||
component: Home |
|||
}, |
|||
{ |
|||
path: '/about', |
|||
name: 'About', |
|||
component: () => import('../views/tst/About.vue') |
|||
} |
|||
] |
|||
|
|||
const router = createRouter({ |
|||
history: createWebHashHistory(), |
|||
routes |
|||
history: createWebHashHistory(), |
|||
routes |
|||
}) |
|||
|
|||
export default router |
|||
export default router |
|||
|
@ -1,18 +1,18 @@ |
|||
import axios from "axios" |
|||
import axios from 'axios' |
|||
|
|||
const service = axios.create({ |
|||
baseURL: 'http://127.0.0.1:8888', |
|||
timeout: 10000 |
|||
baseURL: 'http://127.0.0.1:8888', |
|||
timeout: 10000 |
|||
}) |
|||
|
|||
service.interceptors.request.use(config => { |
|||
return config |
|||
return config |
|||
}) |
|||
|
|||
service.interceptors.response.use(response => { |
|||
return response |
|||
},error => { |
|||
return Promise.reject(error) |
|||
return response |
|||
}, error => { |
|||
return Promise.reject(error) |
|||
}) |
|||
|
|||
export default service |
|||
export default service |
|||
|
@ -1,14 +1,13 @@ |
|||
<template> |
|||
<div>{{name}}</div> |
|||
<div>{{ name }}</div> |
|||
</template> |
|||
|
|||
|
|||
<script setup lang="ts"> |
|||
import {ref} from 'vue' |
|||
import { ref } from 'vue' |
|||
|
|||
const name = ref('this is home') |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
</style> |
|||
|
Loading…
Reference in new issue