1. 스토어의 타입 추론 문제 2개의 인터페이스를 합침 타입 스크립트 선언 병합: https://www.typescriptlang.org/docs/handbook/declaration-merging.html node_modules/vuex/vue.d.ts declare module "vue/types/options" { interface ComponentOptions<V extends Vue> { store?: Store<any>;
Apr 20, 2022Dynamic Routing Next 에서 params 로 넘기는 로직 구현. <template> <div> <user-profile :info="userInfo"> <div slot="username">{{ userInfo.id }}</div> <span slot="time">{{ 'Joined ' + userInfo.created }}, </span> <span slot="karma">{{ userInfo.karma }}</span> </user-profile>
Apr 20, 20221. 스토어 상태 관리 타입스크립트 장점 api 호출 데이터 스펙 정의 스토어를 쓰지 않아도 되는 상황 데이터를 받아와서 하위 컴포넌트 하나에 넘겨주는 간단한 상황
Apr 19, 20221. 뷰 프로젝트에 타입스크립트를 점진적으로 적용하는 방법 Vue+Typescript 프로젝트 생성 기존 서비스 코드와 라이브러리를 새 프로젝트에 이동 기본적인 빌드 에러 해결 타입스크립트의 혜택을 볼 수 있는 주요 파일들 위주로 .js -> .ts로 변환하며 적용 2. HOC 파일에 TS 적용 및 라우터 네비게이션 함수 로직 개선 vue-router
Apr 19, 2022or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up