label, value 형식으로 수정

This commit is contained in:
yoon 2025-02-10 16:07:09 +09:00
parent d47e3f0d6d
commit 608f7be852

View File

@ -1,21 +1,20 @@
<template> <template>
<ul class="cate-list list-unstyled d-flex flex-wrap mb-0"> <ul class="cate-list list-unstyled d-flex flex-wrap mb-0">
<li <li v-for="category in lists" :key="category.value" class="mt-2 mx-1">
v-for="category in lists" <button
:key="category.CMNCODVAL"
class="mt-2 mx-1"
>
<button
type="button" type="button"
class="btn" class="btn"
:class="{ :class="{
'btn-outline-primary': category.CMNCODVAL !== selectedCategory, 'btn-outline-primary': category.value !== selectedCategory,
'btn-primary': category.CMNCODVAL === selectedCategory 'btn-primary': category.value === selectedCategory
}" }"
@click="selectCategory(category.CMNCODVAL)" @click="selectCategory(category.value)"
>{{ category.CMNCODNAM }}</button> >
{{ category.label }}
</button>
</li> </li>
</ul> </ul>
</template> </template>
<script setup> <script setup>
@ -48,10 +47,10 @@ const selectCategory = (cate) => {
.cate-list { .cate-list {
overflow-x: scroll; overflow-x: scroll;
flex-wrap: nowrap !important; flex-wrap: nowrap !important;
li { li {
flex: 0 0 auto; flex: 0 0 auto;
} }
} }
} }
</style> </style>