카테고리수정정

This commit is contained in:
khj0414 2025-03-20 10:11:13 +09:00
parent b393a29026
commit f25ad7ffed

View File

@ -18,8 +18,8 @@
type="button"
class="btn"
:class="{
'btn-outline-primary': category.value !== selectedCategory,
'btn-primary': category.value === selectedCategory
'btn-outline-primary': category.value.toString() !== selectedCategory?.toString(),
'btn-primary': category.value.toString() === selectedCategory?.toString()
}"
@click="selectCategory(category.value)"
>
@ -27,13 +27,11 @@
</button>
</li>
</ul>
</template>
<script setup>
import { defineProps, ref, watch } from 'vue';
import { defineProps, defineEmits, ref, watch } from 'vue';
// lists prop
const props = defineProps({
lists: {
type: Array,
@ -44,7 +42,7 @@ const props = defineProps({
required: false,
},
selectedCategory: {
type: [String, Number],
type: String,
default: null,
required: false,
},
@ -63,4 +61,5 @@ watch(() => props.selectedCategory, (newVal) => {
selectedCategory.value = newVal;
});
</script>