Syw.Frontend

๐Ÿงฉ Vue 2๋กœ ๋ฐฐ์šฐ๋Š” ํ”„๋ก ํŠธ์—”๋“œ ๊ธฐ์ดˆ

2๋‹จ๊ณ„. ๋„ฅ์ŠคํŠธ๊ณต๋ฌด์› ๋ฉ”์ธ Vue + Express๋กœ ๋กœ ํด๋ก ํ•˜๊ธฐ

2-6. ํ€ต๋ฉ”๋‰ด ์šฐ์ธก ์˜์—ญ ๊ตฌํ˜„

์ด์ œ 6๊ฐ•, 7๊ฐ•์€ ์ข€ ๋” ์†๋„๊ฐ์žˆ๊ฒŒ ์ขŒ์šฐ์ธก ํ€ต๋ฉ”๋‰ด๋ฅผ ๊ตฌ์„ฑํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.


โœ… src/components/RightQuickMenu.vue

<template>
  <div class="right-quick-menu">
    <div class="quick-card play-card">
      <img
        src="https://img.megagong.net/m/2025/0715_playground/bnr_right_gong1.png"
        alt="์ด๋ฒคํŠธ ์ด๋ฏธ์ง€"
      />
    </div>

    <div class="quick-card coupon-card">
      <p class="badge">30% ํ• ์ธ<br />์ฟ ํฐ ์ฆ์ •</p>
      <p class="main-text">e-๊ต์žฌ<br /><span class="blue">์ฒซ ๊ตฌ๋งค ์ด๋ฒคํŠธ</span></p>
      <button class="detail-btn">์ž์„ธํžˆ ๋ณด๊ธฐ</button>
    </div>

    <div class="quick-card nextpass-card">
      <p class="small">๋ชจ๋“  ์ˆ˜ํ—˜์ƒ์„ ์œ„ํ•œ</p>
      <p class="blue-bold">๊ณต๋ฌด์› ๋„ฅ์ŠคํŠธํŒจ์Šค<br />๋งž์ถค ํ• ์ธ ํ˜œํƒ</p>
      <button class="tag-btn on">์ „ยทํ˜„์ง ๊ณต๋ฌด์›</button>
      <button class="tag-btn">ํฌ๋ง ์ธ๊ธฐ๊ฐ€<br />(์ €์†Œ๋“/์ฐจ์ƒ์œ„)</button>
    </div>
  </div>
</template>

<script>
export default {
  name: "RightQuickMenu",
};
</script>

<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;
}

.quick-card {
  width: 120px;
  padding: 10px;
  border-radius: 12px;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid #ddd;
  background: #fff;
}

.play-card {
  padding: 0;
  border: 0;
}

.badge {
  font-weight: bold;
  color: #222;
}

.main-text {
  margin: 4px 0;
}

.main-text .blue {
  color: #0070f3;
  font-weight: 700;
}

.detail-btn {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  margin-top: 4px;
}

.nextpass-card .blue-bold {
  color: #0070f3;
  font-weight: 700;
  margin: 4px 0;
}

.nextpass-card .tag-btn {
  background-color: #eee;
  border: none;
  font-size: 11px;
  border-radius: 3ch;
  padding: 2px 6px;
  margin-bottom: 4px;
  &.on {
    background: #0070f3;
    color: #fff;
  }
  &:last-child {
    margin-bottom: 0;
  }
}

.sub-text {
  font-size: 11px;
  color: #666;
}
</style>

โœ… src/components/LeftQuickMenu.vue

<template>
  <div class="left-quickmenu">
    <div>[ ์ขŒ์ธก ์‚ฌ์ด๋“œ ๊ณ ์ • ๋ฉ”๋‰ด ]</div>
  </div>
</template>

<style scoped>
.left-quickmenu {
  position: absolute;
}
</style>

์ปจํ…์ธ  ์˜์—ญ ์ขŒ์šฐ ๊ท ํ˜•์„ ์œ„ํ•ด์„œ ์ขŒ์ธก ์‚ฌ์ด๋“œ๋ฉ”๋‰ด๋ฅผ ๋จผ์ € position: absolute ๋กœ ๋„์–ด์ค๋‹ˆ๋‹ค.


โœ… src/assets/base.scss

*,
*::before,
*::after {
  box-sizing: border-box;
}

๐ŸŽฏ ๋‹ค์Œ ๊ณผ์ œ

์•„๋ž˜ ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•ด๋ณด์„ธ์š”!

  1. RigthQuickMenu.vue ๋‚ด๋ถ€ .tab-btn์— ํด๋ž˜์Šค on์ด 3์ดˆ์— ํ•œ๋ฒˆ์”ฉ ์ž๋™์ „ํ™˜๋˜๊ฒŒ ํ•ด๋ณด์„ธ์š”.

GitHub - heroyooi/vue2-megagong at ch6

๐Ÿ’ฌ ๋Œ“๊ธ€

    โ€ป ๋กœ๊ทธ์ธ ํ›„ ๋Œ“๊ธ€์„ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.