diff --git a/.eslintrc.js b/.eslintrc.js index 74ae94395..b9d550ffa 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,6 +19,10 @@ module.exports = { '@vue/typescript' ], + plugins: [ + 'vue' + ], + rules: { "vue/max-attributes-per-line": [2, { "singleline": 10, @@ -216,15 +220,5 @@ module.exports = { "ignores": ["pre", "textarea"] }], "vue/mustache-interpolation-spacing": [0, "always" | "never"], - }, - - plugins: [ - 'vue' - ], - 'extends': [ - 'eslint:recommended', - 'plugin:vue/strongly-recommended', - '@vue/standard', - '@vue/typescript' - ] + } } diff --git a/mock/article.ts b/mock/article.ts index 95c7a6077..913e32952 100644 --- a/mock/article.ts +++ b/mock/article.ts @@ -4,8 +4,8 @@ import { param2Obj } from '@/utils'; const List: any[] = []; const count = 100; -const baseContent = '

我是测试数据我是测试数据

' -const imageURI = 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3' +const baseContent = '

我是测试数据我是测试数据

'; +const imageURI = 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3'; for (let i = 0; i < count; i++) { List.push(Mock.mock({ @@ -25,7 +25,7 @@ for (let i = 0; i < count; i++) { pageviews: '@integer(300, 5000)', image_uri: imageURI, platforms: ['a-platform'], - })) + })); } export default { @@ -57,7 +57,7 @@ export default { getPv: () => ({ code: 20000, data: { - pvData: [{ key: 'PC', pv: 1024 }, { key: 'mobile', pv: 1024 }, { key: 'ios', pv: 1024 }, { key: 'android', pv: 1024 }]; + pvData: [{ key: 'PC', pv: 1024 }, { key: 'mobile', pv: 1024 }, { key: 'ios', pv: 1024 }, { key: 'android', pv: 1024 }], }, }), @@ -74,7 +74,7 @@ export default { code: 20000, data: { data: 'success', - } + }, }), updateArticle: () => ({ @@ -82,5 +82,5 @@ export default { data: { data: 'success', }, - }) -} + }), +}; diff --git a/mock/index.ts b/mock/index.ts index 274b44c73..7ee6034f7 100644 --- a/mock/index.ts +++ b/mock/index.ts @@ -13,8 +13,6 @@ Mock.mock(/\/user\/logout/, 'post', userAPI.logout); // Table Mock.mock(/\/table\/list/, 'get', tableAPI.list); - - // 文章相关 Mock.mock(/\/article\/list/, 'get', articleAPI.getList); Mock.mock(/\/article\/detail/, 'get', articleAPI.getArticle); diff --git a/mock/remoteSearch.ts b/mock/remoteSearch.ts index 00d2b8c65..dbd1c4796 100644 --- a/mock/remoteSearch.ts +++ b/mock/remoteSearch.ts @@ -1,24 +1,24 @@ -import Mock from 'mockjs' -import { param2Obj } from '@/utils' +import Mock from 'mockjs'; +import { param2Obj } from '@/utils'; -const NameList: any[] = [] -const count = 100 +const NameList: any[] = []; +const count = 100; for (let i = 0; i < count; i++) { NameList.push(Mock.mock({ - name: '@first' - })) + name: '@first', + })); } -NameList.push({ name: 'mockPan' }) +NameList.push({ name: 'mockPan' }); export default { searchUser: (config: {url: string}) => { - const { name } = param2Obj(config.url) as any + const { name } = param2Obj(config.url) as any; const mockNameList = NameList.filter(item => { - const lowerCaseName = item.name.toLowerCase() - if (name && lowerCaseName.indexOf(name.toLowerCase()) < 0) return false - return true - }) - return { items: mockNameList } - } -} + const lowerCaseName = item.name.toLowerCase(); + if (name && lowerCaseName.indexOf(name.toLowerCase()) < 0) return false; + return true; + }); + return { items: mockNameList }; + }, +}; diff --git a/mock/transaction.ts b/mock/transaction.ts index 9dd31d531..95e8dfeed 100644 --- a/mock/transaction.ts +++ b/mock/transaction.ts @@ -1,4 +1,4 @@ -import Mock from 'mockjs' +import Mock from 'mockjs'; const List: any[] = []; const count = 20; @@ -9,8 +9,8 @@ for (let i = 0; i < count; i++) { timestamp: +Mock.Random.date('T'), username: '@name()', price: '@float(1000, 15000, 0, 2)', - 'status|1': ['success', 'pending'] - })) + 'status|1': ['success', 'pending'], + })); } export default { @@ -18,8 +18,8 @@ export default { return { code: 20000, data: { total: List.length, - items: List + items: List, }, }; }, -} +}; diff --git a/src/api/remoteSearch.ts b/src/api/remoteSearch.ts index 114755e71..b46a8d2dd 100644 --- a/src/api/remoteSearch.ts +++ b/src/api/remoteSearch.ts @@ -1,8 +1,8 @@ -import request from '@/utils/request' +import request from '@/utils/request'; export const userSearch = (name: string): any => request({ url: '/search/user', method: 'get', - params: { name } + params: { name }, }); diff --git a/src/components/BackToTop/index.vue b/src/components/BackToTop/index.vue index e58cf97cc..f65674aba 100644 --- a/src/components/BackToTop/index.vue +++ b/src/components/BackToTop/index.vue @@ -11,25 +11,24 @@ - diff --git a/src/components/Dropzone/index.vue b/src/components/Dropzone/index.vue index 61ea82555..5a0cea74d 100644 --- a/src/components/Dropzone/index.vue +++ b/src/components/Dropzone/index.vue @@ -6,11 +6,11 @@ diff --git a/src/components/LangSelect/index.vue b/src/components/LangSelect/index.vue index 5fb9ce5c1..9ece2c7de 100644 --- a/src/components/LangSelect/index.vue +++ b/src/components/LangSelect/index.vue @@ -12,15 +12,15 @@ diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue index b63a82873..49aeea68d 100644 --- a/src/components/ThemePicker/index.vue +++ b/src/components/ThemePicker/index.vue @@ -6,13 +6,11 @@