Merge branch 'khj'
This commit is contained in:
commit
8c2bbe188b
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user