전체 글
-
[5주차] 서버에서 데이터 입력받아 arr에 저장하기Vue.js/Way Home 2022. 10. 11. 23:02
문제점 : [[Prototype]]: Promise안에 data.list 값을 추출하고 싶다. 실행 과정 : 1. function getData() { highwayApiData.then((data) => { const highwayList1: highway[] = data.data.list; console.log(highwayList1); }); } https://velog.io/@zzero9158/javascript-promise%EC%9D%98-%EA%B0%92-%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0 [javascript] promise의 값 가져오기 promise result에 접근하는 방법 velog.io ==> function 과정을 거쳐야 하고, 지역 list로 생..
-
[5주차] TypeScript로 객체 배열 중복 제거 구현하기Vue.js/Way Home 2022. 10. 11. 16:06
문제점 : 카테고리 첫 번째 select문에서 같은 데이터값이 나열되고 있다. 해결 방법 : const removeDuplicates = (array: Array, key: string) => { return array.reduce((arr, item) => { const removed = arr.filter((i: any) => i[key] !== item[key]); return [...removed, item]; }, []); }; const high: highway[] = removeDuplicates(highwayList, 'routeNm'); routeNm 값이 중복되면 객체 value를 제거하게 작성했다. 참고 사이트 : https://ko.code-paper.com/javascript/ex..
-
[모달창 구현] 모달창 구현 방법Vue.js/Way Home 2022. 9. 26. 18:31
목적 : 모달창 열기 닫기 버튼 생성 코드 : 공통 닫기 (생략) export default { name: 'qaView', data() { return { modal: false, } } } body { margin : 0 } div { box-sizing: border-box; } .black-bg { width: 100%; height : 100%; background :rgba(111, 110, 110, 0.5); position: fixed; padding :20px; } .white-bg { width :100%; background: white; border-radius: 8px; padding: 20px; } 실행화면 :
-
[firebase 보안오류] Firebase: This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console. (auth/unauthorized-domain).React 2022. 9. 23. 17:37
문제 : github에 배포 후에 소셜 로그인이 작동되지 않고 아래 에러 메시지 창이 뜬다. 이유: 파이업이스의 접근 권한 보안 설정으로 도메인이 인증되지 않아 firebase의 접근이 막혀있다. 해결 방법 : firebase 콘솔 >> Authentication >> setting >> 승인된 도메인에 url을 적어준다. 단, 위 사진처럼 도메인에 https를 제외하고 적어주어야 한다. 위 과정대로 하면 배포된 도메인에서 firebase가 실행되는 것을 볼 수 있다.
-
[firestore에러] Firebase Storage: An unknown error occurred, please check the error payload for server responseReact 2022. 9. 23. 13:19
문제점: 파이어 스토어에 이미지 업로드를 할 수 없다. 이유 : 파이어스토어의 보안 규칙이 업로드를 제한하고 있기 때문이다. 해결방법 : 파이어 스토어 >> 콘솔 >> 빌드 >> storage >> Rules 에 들어가 규칙을 아래와 같이 수정해준다. rules_version = '2'; service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { allow read, write: if true; } } } 그럼 사진이 저장이 되는 것을 확인할 수 있다. 참고 사이트 https://stackoverflow.com/questions/70052479/firebase-storage-an-unknown-error-occurred-please-c..
-
[Redirect, useHistory] 리액트 v6에서 없어졌다.React 2022. 9. 22. 21:12
[클론코딩 트위터] 104p 코드이다. // import { useState } from "react"; import { HashRouter as Router,Redirect, Route, Routes } from "react-router-dom"; import Auth from "routes/Auth"; import Home from "routes/Home"; import Profile from "routes/Profile" import Navigation from "./Navigation"; const AppRouter = ({isLoggedIn}) => { // const [isLoggedIn, setIsLoggedIn] = useState(true); return ( {isLoggedIn && }..
-
[firebase] 설정 오류 해결하기React 2022. 9. 21. 14:27
import { firebase } from "firebase/app"; // TODO: Add SDKs for Firebase products that you want to use // https://firebase.google.com/docs/web/setup#available-libraries // Your web app's Firebase configuration const firebaseConfig = { apiKey: "AIzaSyD_aU7oUOMoiFJpD3DdvDs3YPjQKe4-Yp0", authDomain: "twitter-3141f.firebaseapp.com", projectId: "twitter-3141f", storageBucket: "twitter-3141f.appspot.co..