Skip to content

Commit

Permalink
feat: add list card/card
Browse files Browse the repository at this point in the history
  • Loading branch information
nxhawk committed Jun 19, 2024
1 parent 40069fc commit e4f376e
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script setup>
import 'primeicons/primeicons.css'
</script>
Expand Down
12 changes: 12 additions & 0 deletions src/components/Card.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template lang="">
<div>
<router-link to="">
<img src="https://api.baitaptracnghiem.com/storage/images/76ji3bW7kV8MFwkTr1VI123b0E7IBDbH1me2pmey.webp" alt="exercise-background" class="w-fit rounded-lg object-contain"/>
<div class="text-md mt-3">Thi thử THPT môn Sinh Học online - Đề minh họa năm 2024 của Bộ GD&ĐT</div>
</router-link>
</div>
</template>

<script setup>
</script>
10 changes: 9 additions & 1 deletion src/components/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
</template>

<script setup>
const props = defineProps(['icon', 'className']);
const props = defineProps({
icon: {
type: String,
required: true,
},
className: {
type: String,
}
});
</script>
25 changes: 25 additions & 0 deletions src/components/ListCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<template lang="">
<div>
<router-link :to="props.url" class="mb-5 text-3xl font-bold hover:text-[#67c23a] text-center md:text-left">
<h1 class="mb-5 text-3xl font-bold hover:text-[#67c23a] text-center md:text-left">{{ title }}</h1>
</router-link>
<div class="grid md:grid-cols-3 gap-x-8 md:gap-y-10 gap-y-5 grid-cols-1 mb-10">
<Card v-for="n in 6" :key="n"/>
</div>
</div>
</template>

<script setup>
import Card from"@/components/Card.vue";
const props = defineProps({
title: {
type: String,
required: true,
},
url: {
type: String,
required: true,
}
});
</script>
2 changes: 1 addition & 1 deletion src/layout/Footer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="">
<div class="h-16 bg-slate-100 flex items-center justify-center">
<div class="h-16 bg-slate-100 flex items-center justify-center mt-5">
Footer
</div>
</template>
Expand Down
10 changes: 6 additions & 4 deletions src/views/HomePage.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<template lang="">

<div>
Home page
<div class="px-5 md:px-20 mt-2">
<ListCard title="Đề thi THPT" url="/"/>
<ListCard title="Lớp 12" url="/"/>
</div>
</template>
<script setup lang="ts">

<script setup>
import ListCard from"@/components/ListCard.vue";
</script>

0 comments on commit e4f376e

Please sign in to comment.