Merge branch 'khj'

This commit is contained in:
khj0414 2025-03-10 16:19:29 +09:00
commit 8c2bbe188b

View File

@ -31,7 +31,7 @@
</template>
<script setup>
import { defineProps, ref } from 'vue';
import { defineProps, ref, watch } from 'vue';
// lists prop
const props = defineProps({
@ -43,21 +43,29 @@ const props = defineProps({
type: Boolean,
required: false,
},
selectedCategory: {
type: [String, Number],
default: null,
required: false,
},
});
//
const selectedCategory = ref(null);
const emit = defineEmits();
const selectedCategory = ref(props.selectedCategory);
const emit = defineEmits(['update:data']);
const selectCategory = (cate) => {
selectedCategory.value = selectedCategory.value === cate ? null : cate;
emit('update:data', selectedCategory.value);
};
watch(() => props.selectedCategory, (newVal) => {
selectedCategory.value = newVal;
});
</script>
<style scoped>
@media (max-width: 768px) {
.cate-list {
overflow-x: scroll;