|
1 | 1 | <script setup>
|
2 | 2 | import { KakaoMap } from 'vue3-kakao-maps';
|
3 |
| -import { ref, onMounted, computed } from 'vue'; |
| 3 | +import { ref, onMounted, computed , watch } from 'vue'; |
4 | 4 | import axios from 'axios';
|
5 | 5 | import { useHouseInfoStore } from '@/stores/mapCard';
|
6 | 6 | import CardView from './CardView.vue';
|
7 | 7 | import Button from '@/Component/Button/Button.vue';
|
| 8 | +import 'vue-range-slider/dist/vue-range-slider.css' |
8 | 9 |
|
9 | 10 | const map = ref(null); // Kakao Map 객체
|
10 | 11 | const polygons = ref([]); // 생성된 폴리곤 객체 배열
|
@@ -135,9 +136,25 @@ const rangeSlider = document.getElementById("rangeSlider");
|
135 | 136 | });
|
136 | 137 | });
|
137 | 138 |
|
| 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 | +
|
138 | 154 |
|
139 | 155 | </script>
|
140 | 156 |
|
| 157 | + |
141 | 158 | <template>
|
142 | 159 | <div class="flex flex-row items-center w-full h-[100vh] pt-20">
|
143 | 160 | <!-- 버튼 영역 -->
|
@@ -177,38 +194,84 @@ const rangeSlider = document.getElementById("rangeSlider");
|
177 | 194 | <!-- 지도 및 필터 영역 -->
|
178 | 195 | <div class="flex flex-col justify-start w-full h-full">
|
179 | 196 |
|
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> |
190 | 225 |
|
191 |
| - <!-- Range Slider (초기에는 숨겨짐) --> |
192 | 226 | <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 | + |
197 | 259 | </div>
|
198 | 260 |
|
| 261 | + |
199 | 262 |
|
200 | 263 |
|
201 |
| - <!-- 리셋 버튼 --> |
202 | 264 | <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">
|
203 | 265 | <svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
|
204 | 266 | <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"/>
|
205 | 267 | </svg>
|
206 | 268 | </button>
|
| 269 | + |
207 | 270 | </div>
|
208 | 271 | <!-- 리스트와 지도 영역 -->
|
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"> |
210 | 273 | <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"> |
212 | 275 | <p class="mr-1 ml-2 cursor-pointer font-bold">인기순</p>
|
213 | 276 | <p class="mr-1 cursor-pointer font-bold">가격순</p>
|
214 | 277 | <p class="mr-1 cursor-pointer font-bold">면적순</p>
|
|
0 commit comments