Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: course pack scroll bug #724

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]);
},
],
};
Loading