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

style: 优化选中关卡体验 #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 19 additions & 3 deletions src/pages/LevelsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<a-list item-layout="horizontal" :data-source="mainLevels">
<template #renderItem="{ item: level, index }">
<a-list-item>
<a-list-item-meta :title="`${index + 1}、${level.title}`" />
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么不选择在 title 外面套路由呢?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也可以, 但是要给 a 中的 li 加个 border-bottom, 不然样式和原来的不一致了

<template #actions>
<router-link :to="`/learn/${level.key}`">
<a-list-item-meta :title="`${index + 1}、${level.title}`" />
<a-button>挑战</a-button>
</router-link>
</template>
Expand All @@ -22,9 +22,9 @@
<a-list item-layout="horizontal" :data-source="customLevels">
<template #renderItem="{ item: level }">
<a-list-item>
<a-list-item-meta :title="level.title" />
<template #actions>
<router-link :to="`/learn/${level.key}`">
<a-list-item-meta :title="level.title" />
<a-button>挑战</a-button>
</router-link>
</template>
Expand All @@ -42,4 +42,20 @@ import mainLevels from "../levels/mainLevels";
import customLevels from "../levels/customLevels";
</script>

<style scoped></style>
<style scoped>
:deep .ant-list-item a {
display: flex;
align-items: center;
}
:deep .ant-list-item-action {
width: 100%;
margin-left: 0;
}
:deep .ant-list-item-action > li {
display: block;
text-align: unset;
}
:deep .ant-list-item-meta-title:hover {
color: #40a9ff;
}
</style>