Skip to content

Commit e16d95d

Browse files
fix : css about filtering
1 parent 59cb09e commit e16d95d

File tree

4 files changed

+133
-37
lines changed

4 files changed

+133
-37
lines changed

package-lock.json

Lines changed: 22 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"lint": "eslint . --fix"
1111
},
1212
"dependencies": {
13+
"@vueform/slider": "^2.1.10",
1314
"aos": "^2.3.4",
1415
"axios": "^1.7.7",
1516
"dotenv": "^16.4.5",
@@ -21,6 +22,7 @@
2122
"typed.js": "^2.1.0",
2223
"vue": "^3.5.12",
2324
"vue-fullpage.js": "^0.2.20",
25+
"vue-range-slider": "^0.6.0",
2426
"vue-router": "^4.4.5",
2527
"vue-typer": "^1.2.0",
2628
"vue3-kakao-maps": "^2.3.10"

src/Component/Slider.vue

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<template>
2+
<div>
3+
<Slider v-model="value" :min="0" :max="100" :step="10" tooltips />
4+
<div>선택된 값: {{ value }}</div>
5+
</div>
6+
</template>
7+
8+
<script>
9+
import Slider from '@vueform/slider';
10+
import '@vueform/slider/themes/default.css'; // 테마 파일 추가
11+
12+
export default {
13+
components: {
14+
Slider,
15+
},
16+
data() {
17+
return {
18+
value: 30, // 초기 값 설정
19+
};
20+
},
21+
};
22+
</script>
23+
24+
<style>
25+
/* 스타일 추가 */
26+
</style>
27+

src/views/MapView.vue

Lines changed: 82 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<script setup>
22
import { KakaoMap } from 'vue3-kakao-maps';
3-
import { ref, onMounted, computed } from 'vue';
3+
import { ref, onMounted, computed , watch } from 'vue';
44
import axios from 'axios';
55
import { useHouseInfoStore } from '@/stores/mapCard';
66
import CardView from './CardView.vue';
77
import Button from '@/Component/Button/Button.vue';
8+
import 'vue-range-slider/dist/vue-range-slider.css'
89
910
const map = ref(null); // Kakao Map 객체
1011
const polygons = ref([]); // 생성된 폴리곤 객체 배열
@@ -135,9 +136,25 @@ const rangeSlider = document.getElementById("rangeSlider");
135136
});
136137
});
137138
139+
import RangeSlider from 'vue-simple-range-slider';
140+
import 'vue-simple-range-slider/css';
141+
import { reactive } from 'vue';
142+
// 슬라이더 값을 반응형으로 관리
143+
const state = reactive({
144+
value: [10, 100], // 범위 슬라이더의 두 값
145+
valuee : 40,
146+
});
147+
148+
149+
// state.value가 변경될 때마다 콘솔에 값 출력
150+
watch(() => state.value, (newValue) => {
151+
console.log('선택한 값:', newValue);
152+
}, { deep: true });
153+
138154
139155
</script>
140156

157+
141158
<template>
142159
<div class="flex flex-row items-center w-full h-[100vh] pt-20">
143160
<!-- 버튼 영역 -->
@@ -177,38 +194,84 @@ const rangeSlider = document.getElementById("rangeSlider");
177194
<!-- 지도 및 필터 영역 -->
178195
<div class="flex flex-col justify-start w-full h-full">
179196

180-
<!-- 필터 버튼 -->
181-
<div class="flex flex-row items-center m-0 bg-white h-14 border-b border-gray-200">
182-
<div v-for="(filter, index) in filters" :key="index" class="relative inline-block text-left ml-2">
183-
<button type="button" id="filterButton" class="inline-flex justify-between w-full h-8 border border-gray-300 shadow-sm px-4 py-2 bg-white text-xs font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-1 focus:ring-indigo-500">
184-
{{ filter }}
185-
<svg class="-mr-1 ml-2 h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
186-
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 011.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
187-
</svg>
188-
</button>
189-
</div>
197+
<!-- 필터 전체 버튼 -->
198+
<div class="flex flex-row items-center py-4 h-14 border-b border-gray-200">
199+
200+
<!--검색 창-->
201+
<div class="relative w-[370px] ml-4 mr-2">
202+
<input
203+
type="text"
204+
placeholder="찾고자하는 아파트 이름을 입력하세요"
205+
class="w-full h-8 px-4 pr-10 text-sm text-gray-700 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
206+
/>
207+
<button
208+
type="button"
209+
class="absolute inset-y-0 right-0 flex items-center px-3 text-gray-500 hover:text-gray-700">
210+
<svg
211+
class="w-4 h-4"
212+
aria-hidden="true"
213+
xmlns="http://www.w3.org/2000/svg"
214+
fill="none"
215+
viewBox="0 0 20 20">
216+
<path
217+
stroke="currentColor"
218+
stroke-linecap="round"
219+
stroke-linejoin="round"
220+
stroke-width="2"
221+
d="M19 19l-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/>
222+
</svg>
223+
</button>
224+
</div>
190225

191-
<!-- Range Slider (초기에는 숨겨짐) -->
192226
<div v-for="(filter, index) in filters" :key="index" class="relative inline-block text-left ml-2">
193-
<div id="rangeSlider" class="hidden mt-4">
194-
<input type="range" min="0" max="100" value="50" class="w-full h-2 bg-gray-300 rounded-lg appearance-none cursor-pointer" id="myRange">
195-
<span id="sliderValue" class="text-xs font-medium text-gray-700 mt-2">50</span>
196-
</div>
227+
<!-- 버튼 -->
228+
<button id="filterButton" type="button"
229+
class=" flex flex-row items-center w-full h-8 border border-gray-300 shadow-sm pl-2 text-xs font-medium text-gray-700 hover:bg-gray-50 focus:outline-none">
230+
<div> {{ filter }} </div>
231+
<svg class="h-4 w-6 text-gray-800" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
232+
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 011.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
233+
</svg>
234+
</button>
235+
<!-- 아이콘 -->
236+
<div class="bg-white absolute z-10 w-[200px] h-[120px] top-10 left-0 hidden border-2 border-gray-200" id="rangeSlider">
237+
<RangeSlider
238+
v-model="state.value"
239+
style="width: 90%"
240+
exponential
241+
:max="10000"
242+
class="m-auto mt-[25px]"
243+
>
244+
<!-- 슬라이더 끝에 '$' 기호 표시 -->
245+
<template #suffix>만원</template>
246+
</RangeSlider>
247+
248+
249+
</div>
250+
251+
252+
253+
254+
255+
256+
257+
258+
197259
</div>
198260

261+
199262

200263

201-
<!-- 리셋 버튼 -->
202264
<button type="button" class="relative inline-block text-left ml-2 h-8 px-2 py-2 bg-white border border-gray-300 shadow-sm focus:ring-indigo-500">
203265
<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
204266
<path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/>
205267
</svg>
206268
</button>
269+
207270
</div>
208271
<!-- 리스트와 지도 영역 -->
209-
<div class="flex flex-row h-full font-PretendardRegular text-gray-800">
272+
<div class="flex flex-row h-full font-Pretendard text-gray-600">
210273
<div class="flex flex-col h-full rounded-lg">
211-
<div class="flex flex-row p-2 text-xs border-b-2">
274+
<div class="flex flex-row p-2 text-s bg-blue-100">
212275
<p class="mr-1 ml-2 cursor-pointer font-bold">인기순</p>
213276
<p class="mr-1 cursor-pointer font-bold">가격순</p>
214277
<p class="mr-1 cursor-pointer font-bold">면적순</p>

0 commit comments

Comments
 (0)