Skip to content

Commit

Permalink
fix: course pack scroll bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yaolifeng0629 committed Jun 22, 2024
1 parent 1691069 commit 32dc6a1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
16 changes: 9 additions & 7 deletions apps/client/pages/course-pack/index.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<template>
<div class="flex w-full flex-col">
<h2 class="my-10 text-2xl font-bold">多课程包</h2>
<h2 class="mb-4 text-2xl font-bold">多课程包</h2>
<template v-if="isLoading">
<Loading></Loading>
</template>
<template v-else>
<div
class="grid grid-cols-1 justify-items-center gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"
>
<template v-for="coursePack in coursePackStore.coursePacks">
<CoursePackCard :coursePack="coursePack"></CoursePackCard>
</template>
<div class="h-[79vh] overflow-y-auto overflow-x-hidden scrollbar-hide">
<div
class="grid grid-cols-1 justify-items-center gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"
>
<template v-for="coursePack in coursePackStore.coursePacks">
<CoursePackCard :coursePack="coursePack"></CoursePackCard>
</template>
</div>
</div>
</template>
</div>
Expand Down
14 changes: 13 additions & 1 deletion apps/client/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
// 来这里找 https://icones.js.org/
collections: getIconCollections(["ph", "simple-icons"]),
}),
function ({ addComponents }) {
function ({ addComponents, addUtilities }) {
const buttons = {
".tw-btn-blue": {
backgroundColor: "#4e80ee",
Expand All @@ -69,6 +69,18 @@ export default {
};

addComponents(buttons);

const scrollbar = {
".scrollbar-hide": {
"-ms-overflow-style": "none" /* 适用于 IE 和 Edge */,
"scrollbar-width": "none" /* 适用于 Firefox */,
},
".scrollbar-hide::-webkit-scrollbar": {
display: "none",
},
};

addUtilities(scrollbar, ["responsive"]);
},
],
};

0 comments on commit 32dc6a1

Please sign in to comment.