hookehuyr

新增eslint-plugin-vue页面测试

1 +module.exports = {
2 + extends: [
3 + // add more generic rule sets here, such as:
4 + // 'eslint:recommended',
5 + 'plugin:vue/vue3-recommended',
6 + // 'plugin:vue/recommended' // Use this if you are using Vue.js 2.x.
7 + ],
8 + rules: {
9 + // override/add rules settings here, such as:
10 + // 'vue/no-unused-vars': 'error'
11 + "vue/max-attributes-per-line": ["error", {
12 + "singleline": {
13 + "max": 10
14 + },
15 + "multiline": {
16 + "max": 5
17 + }
18 + }]
19 + }
20 +}
...@@ -8,12 +8,14 @@ ...@@ -8,12 +8,14 @@
8 "build": "vite build", 8 "build": "vite build",
9 "build-watch": "vite build --watch", 9 "build-watch": "vite build --watch",
10 "build-ts": "vue-tsc --noEmit && vite build", 10 "build-ts": "vue-tsc --noEmit && vite build",
11 - "serve": "vite preview" 11 + "serve": "vite preview",
12 + "cypress:open": "cypress open"
12 }, 13 },
13 "dependencies": { 14 "dependencies": {
14 "@vitejs/plugin-legacy": "^1.8.2", 15 "@vitejs/plugin-legacy": "^1.8.2",
15 "@vueuse/core": "^8.5.0", 16 "@vueuse/core": "^8.5.0",
16 "animate.css": "^4.1.1", 17 "animate.css": "^4.1.1",
18 + "global": "^4.4.0",
17 "html2canvas": "^1.4.1", 19 "html2canvas": "^1.4.1",
18 "jquery": "^3.6.0", 20 "jquery": "^3.6.0",
19 "js-cookie": "^3.0.1", 21 "js-cookie": "^3.0.1",
...@@ -35,7 +37,11 @@ ...@@ -35,7 +37,11 @@
35 "@vitejs/plugin-vue": "^2.3.3", 37 "@vitejs/plugin-vue": "^2.3.3",
36 "@vue/compiler-sfc": "^3.2.34", 38 "@vue/compiler-sfc": "^3.2.34",
37 "axios": "^0.26.1", 39 "axios": "^0.26.1",
40 + "chai": "^4.3.6",
41 + "cypress": "^9.7.0",
42 + "eslint-plugin-vue": "^9.0.1",
38 "less": "^4.1.2", 43 "less": "^4.1.2",
44 + "mocha": "^10.0.0",
39 "pinia": "^2.0.14", 45 "pinia": "^2.0.14",
40 "postcss-px-to-viewport": "^1.1.1", 46 "postcss-px-to-viewport": "^1.1.1",
41 "qs": "^6.10.3", 47 "qs": "^6.10.3",
......
1 <template> 1 <template>
2 <div class="choose-book-page content-bg"> 2 <div class="choose-book-page content-bg">
3 - <div class="modify-top"></div> 3 + <div class="modify-top" />
4 - <div class="belong-school" v-if="kg_id"> 4 + <div v-if="kg_id" class="belong-school">
5 - <van-row align="center" justify="center" style="position: relative; top: 50%; transform: translateY(-50%);"> 5 + <van-row align="center" justify="center" style="position: relative; top: 50%; transform: translateY(-50%)">
6 <van-col span="2"> 6 <van-col span="2">
7 - <van-image v-if="kgInfo.logo" round width="3rem" height="3rem" lazy-load :src="kgInfo.logo" 7 + <van-image
8 - style="vertical-align: text-bottom;"> 8 + v-if="kgInfo.logo" round width="3rem" height="3rem" lazy-load
9 - <template v-slot:error>加载失败</template> 9 + :src="kgInfo.logo"
10 + style="vertical-align: text-bottom"
11 + >
12 + <template #error>
13 + 加载失败
14 + </template>
10 </van-image> 15 </van-image>
11 - <van-image v-else round width="3rem" height="3rem" lazy-load :src="icon_avatar" 16 + <van-image
12 - style="vertical-align: text-bottom;"> 17 + v-else round width="3rem" height="3rem" lazy-load
13 - <template v-slot:error>加载失败</template> 18 + :src="icon_avatar"
19 + style="vertical-align: text-bottom"
20 + >
21 + <template #error>
22 + 加载失败
23 + </template>
14 </van-image> 24 </van-image>
15 </van-col> 25 </van-col>
16 <van-col span="22"> 26 <van-col span="22">
17 - <p class="title">{{ kgInfo.name }}</p> 27 + <p class="title">
28 + {{ kgInfo.name }}
29 + </p>
18 </van-col> 30 </van-col>
19 </van-row> 31 </van-row>
20 </div> 32 </div>
21 - <div v-else style="height: 2.5rem;"></div> 33 + <div v-else style="height: 2.5rem" />
22 - <div style="position: relative;"> 34 + <div style="position: relative">
23 - <div class="ding left"></div> 35 + <div class="ding left" />
24 - <div style="position: relative; z-index: 100;"> 36 + <div style="position: relative; z-index: 100">
25 <van-row> 37 <van-row>
26 - <van-col span="4"></van-col> 38 + <van-col span="4" />
27 <van-col span="16"> 39 <van-col span="16">
28 - <my-button type="custom" :custom-style="styleObject3">幼儿园爱心书籍</my-button> 40 + <my-button type="custom" :custom-style="styleObject3">
41 + 幼儿园爱心书籍
42 + </my-button>
29 </van-col> 43 </van-col>
30 - <van-col span="4"></van-col> 44 + <van-col span="4" />
31 </van-row> 45 </van-row>
32 </div> 46 </div>
33 - <div class="ding right"></div> 47 + <div class="ding right" />
34 </div> 48 </div>
35 <div class="book-list"> 49 <div class="book-list">
36 <template v-for="(item, key) in kgInfo.book_list" :key="key"> 50 <template v-for="(item, key) in kgInfo.book_list" :key="key">
37 - <book-card type="C" :item="item" @on-click="go('/client/bookDetail', { id: item.id })"></book-card> 51 + <book-card type="C" :item="item" @on-click="go('/client/bookDetail', { id: item.id })" />
38 </template> 52 </template>
39 <van-empty v-if="emptyStatus" class="custom-image" :image="no_image" description="暂无书籍信息" /> 53 <van-empty v-if="emptyStatus" class="custom-image" :image="no_image" description="暂无书籍信息" />
40 </div> 54 </div>
41 - <div style="height: 1rem;"></div> 55 + <div style="height: 1rem" />
42 - <shortcut-fixed type="C" :item="shortcutItem"></shortcut-fixed> 56 + <shortcut-fixed type="C" :item="shortcutItem" />
43 </div> 57 </div>
44 </template> 58 </template>
45 59
46 <script setup> 60 <script setup>
47 -import { _ } from '@/utils/generatePackage' 61 +import { no_image, icon_avatar } from '@/utils/generateIcons';
48 -import { no_image, icon_avatar } from '@/utils/generateIcons' 62 +import { MyButton, ShortcutFixed, BookCard } from '@/utils/generateModules';
49 -import { MyButton, ShortcutFixed, BookCard } from '@/utils/generateModules' 63 +import { styleObject3 } from '@/settings/designSetting.js';
50 -import { styleObject3 } from '@/settings/designSetting.js'
51 import { useBookList, useShortcutBar } from '@/composables'; 64 import { useBookList, useShortcutBar } from '@/composables';
52 -import { useGo } from '@/hooks/useGo' 65 +import { useGo } from '@/hooks/useGo';
53 -import { killPages, store } from '@/hooks/useKeepAlive' 66 +import { killPages, store } from '@/hooks/useKeepAlive';
54 67
55 -const go = useGo() 68 +const go = useGo();
56 69
57 // 删除所有的 keep-alive 缓存 70 // 删除所有的 keep-alive 缓存
58 killPages(); 71 killPages();
...@@ -83,7 +96,6 @@ const { shortcutItem } = useShortcutBar(); // 配置快捷跳转条 ...@@ -83,7 +96,6 @@ const { shortcutItem } = useShortcutBar(); // 配置快捷跳转条
83 vertical-align: super; 96 vertical-align: super;
84 margin-left: 2rem; 97 margin-left: 2rem;
85 } 98 }
86 -
87 } 99 }
88 100
89 .book-list { 101 .book-list {
......
This diff is collapsed. Click to expand it.