Skip to content

Commit 32dc6a1

Browse files
committed
fix: course pack scroll bug
1 parent 1691069 commit 32dc6a1

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

apps/client/pages/course-pack/index.vue

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<template>
22
<div class="flex w-full flex-col">
3-
<h2 class="my-10 text-2xl font-bold">多课程包</h2>
3+
<h2 class="mb-4 text-2xl font-bold">多课程包</h2>
44
<template v-if="isLoading">
55
<Loading></Loading>
66
</template>
77
<template v-else>
8-
<div
9-
class="grid grid-cols-1 justify-items-center gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"
10-
>
11-
<template v-for="coursePack in coursePackStore.coursePacks">
12-
<CoursePackCard :coursePack="coursePack"></CoursePackCard>
13-
</template>
8+
<div class="h-[79vh] overflow-y-auto overflow-x-hidden scrollbar-hide">
9+
<div
10+
class="grid grid-cols-1 justify-items-center gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"
11+
>
12+
<template v-for="coursePack in coursePackStore.coursePacks">
13+
<CoursePackCard :coursePack="coursePack"></CoursePackCard>
14+
</template>
15+
</div>
1416
</div>
1517
</template>
1618
</div>

apps/client/tailwind.config.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default {
5656
// 来这里找 https://icones.js.org/
5757
collections: getIconCollections(["ph", "simple-icons"]),
5858
}),
59-
function ({ addComponents }) {
59+
function ({ addComponents, addUtilities }) {
6060
const buttons = {
6161
".tw-btn-blue": {
6262
backgroundColor: "#4e80ee",
@@ -69,6 +69,18 @@ export default {
6969
};
7070

7171
addComponents(buttons);
72+
73+
const scrollbar = {
74+
".scrollbar-hide": {
75+
"-ms-overflow-style": "none" /* 适用于 IE 和 Edge */,
76+
"scrollbar-width": "none" /* 适用于 Firefox */,
77+
},
78+
".scrollbar-hide::-webkit-scrollbar": {
79+
display: "none",
80+
},
81+
};
82+
83+
addUtilities(scrollbar, ["responsive"]);
7284
},
7385
],
7486
};

0 commit comments

Comments
 (0)