โ
LeftQuickMenu.vue
<template>
<div class="left-quickmenu">
<!-- โ
์๋จ 1ํ ๋ฐฐ๋ ์ฌ๋ผ์ด๋ -->
<swiper :options="topSwiperOption" class="tea-swiper">
<swiper-slide v-for="(banner, index) in teaItems" :key="index">
<div class="quick-banner teacher-banner">
<img :src="banner.img" alt="์๋จ ๋ฐฐ๋" />
</div>
</swiper-slide>
<div class="swiper-pagination top-pagination" slot="pagination"></div>
</swiper>
<!-- โ
๊ฐ์ด๋ฐ ๋ฉ๊ฐํฐ -->
<div class="quick-banner megaphone-banner">
<img src="https://img.megagong.net/m/2025/0703_notice/bn_left_sky.png" alt="megaphone" />
</div>
<!-- โ
ํ๋จ OX ํด์ฆ - Swiper -->
<swiper :options="quizSwiperOption" class="ox-swiper">
<swiper-slide v-for="(quiz, index) in quizItems" :key="index">
<div class="quick-banner quiz-banner">
<img :src="quiz.img" alt="ํด์ฆ ๋ฐฐ๋" />
</div>
</swiper-slide>
<div class="swiper-pagination ox-pagination" slot="pagination"></div>
</swiper>
</div>
</template>
<script>
import "swiper/css/swiper.css";
export default {
name: "LeftQuickMenu",
data() {
return {
teaItems: [
{
img: "https://img.megagong.net/m/2025/0710_allawyer/left_sky_bn_gong.png",
},
{
img: "https://img.megagong.net/m/2025/0714_tjenglish08/con_img31.png",
},
],
quizItems: [
{
img: "https://img.megagong.net/m/2025/0625_next/side_left_1_4.png",
},
{
img: "https://img.megagong.net/m/2025/0512_main/side_left_1_2.png",
},
],
topSwiperOption: {
slidesPerView: 1,
loop: true,
autoplay: {
delay: 3500,
disableOnInteraction: false,
},
pagination: {
el: ".top-pagination",
clickable: true,
},
},
quizSwiperOption: {
slidesPerView: 1,
loop: true,
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
pagination: {
el: ".ox-pagination",
clickable: true,
},
},
};
},
};
</script>
<style scoped lang="scss">
.left-quickmenu {
position: absolute;
top: 40px;
right: 50%;
margin-right: 630px;
display: flex;
flex-direction: column;
gap: 12px;
width: 106px;
z-index: 99;
}
.quick-banner {
width: 100%;
img {
width: 100%;
border-radius: 12px;
}
.text {
font-size: 12px;
color: #222;
line-height: 1.4;
strong {
font-weight: bold;
color: #0070f3;
}
}
}
.tea-swiper,
.ox-swiper {
width: 106px;
}
</style>
โ
src/components/RightQuickMenu.vue
์ข์ธก ํต๋ฉ๋ด ๋๋น์ ๋ง์ถฐ์ ์ฐ์ธก ํต๋ฉ๋ด ๋๋น๋ ์กฐ์ ํด์ค๋๋ค.
<style lang="scss" scoped>
.right-quick-menu {
position: absolute;
top: 40px;
left: 50%;
margin-left: 630px;
display: flex;
flex-direction: column;
gap: 12px;
z-index: 99;
width: 106px;
}
.quick-card {
width: 100%;
padding: 10px 5px;
border-radius: 12px;
text-align: center;
font-size: 12px;
line-height: 1.4;
border: 1px solid #ddd;
background: #fff;
}
/* ์๋ต */
</style>
GitHub - heroyooi/vue2-megagong at ch7
์ด์ ์ ๋ฐ์ ์ธ ๋ฅ์คํธ๊ณต๋ฌด์ ํด๋ก ์์ ์ด ๋๋ฌ์ต๋๋ค.
1๋จ๊ณ์์๋ Express
์๋ฒ(BE)์ ์๋ ๋ฐ์ดํฐ๋ค์ Axios
๋ก ์์ฒญํ์ฌ์ **Vuex
**๋ก ์ค์๋ฐ์ดํฐ ๊ด๋ฆฌํ๋ ์ค์ต์ ํด๋ณด์์ต๋๋ค. 2๋จ๊ณ 8๊ฐ๋ถํฐ๋ Express
์๋ฒ(BE)์ ๋ฉ์ธ์์ ์์ฑํ ์ฌ๋ผ์ด๋ ๋ฐ์ดํฐ๋ค์ DB์ ์ ์ฅํ๊ณ Axios๋ก ์์ฒญํ์ฌ์ Vuex
๋ณด๋ค ์ฌ์ฉ๋ฒ์ด ์ฌํํ **Pinia
**๋ก ์ค์๋ฐ์ดํฐ ๊ด๋ฆฌํ๋ ์ค์ต์ ํด๋ณด๊ฒ ์ต๋๋ค.
๐ฌ ๋๊ธ
โป ๋ก๊ทธ์ธ ํ ๋๊ธ์ ์์ฑํ ์ ์์ต๋๋ค.