File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ const Postcode = () => {
4949
5050| name | type | default | description
5151| :----:| :----:| :-------:| :-----------|
52- | scriptUrl | ` string ` | [ CURRENT_URL] ( https://t1.daumcdn .net/mapjsapi/bundle/postcode/prod/postcode.v2.js ) | Daum 우편번호 서비스의 스크립트 주소입니다.|
52+ | scriptUrl | ` string ` | [ CURRENT_URL] ( https://t1.kakaocdn .net/mapjsapi/bundle/postcode/prod/postcode.v2.js ) | Daum 우편번호 서비스의 스크립트 주소입니다.|
5353| onComplete | ` function ` | ` undefined ` | 우편번호 검색이 끝났을 때 사용자가 선택한 정보를 받아올 콜백함수입니다. 주소 데이터의 구성은 [ Daum 가이드] ( http://postcode.map.daum.net/guide ) 를 참고해주세요. |
5454| onSearch | ` function ` | ` undefined ` | 주소를 검색할 경우 실행되는 콜백함수입니다. 검색 결과 정보의 구성은 [ Daum 가이드] ( http://postcode.map.daum.net/guide ) 를 참고해주세요. |
5555| onClose | ` function ` | ` undefined ` | 검색 결과를 선택하여, 서비스가 닫힐 때 실행되는 콜백함수입니다. |
@@ -106,7 +106,7 @@ const Postcode = () => {
106106
107107| name | type | default | description
108108| :----:| :----:| :-------:| :-----------|
109- | scriptUrl | ` string ` | [ CURRENT_URL] ( https://t1.daumcdn .net/mapjsapi/bundle/postcode/prod/postcode.v2.js ) | Daum 우편번호 서비스의 스크립트 주소입니다.|
109+ | scriptUrl | ` string ` | [ CURRENT_URL] ( https://t1.kakaocdn .net/mapjsapi/bundle/postcode/prod/postcode.v2.js ) | Daum 우편번호 서비스의 스크립트 주소입니다.|
110110| onComplete | ` function ` | ` undefined ` | 우편번호 검색이 끝났을 때 사용자가 선택한 정보를 받아올 콜백함수입니다. 주소 데이터의 구성은 [ Daum 가이드] ( http://postcode.map.daum.net/guide ) 를 참고해주세요. |
111111| onSearch | ` function ` | ` undefined ` | 주소를 검색할 경우 실행되는 콜백함수입니다. 검색 결과 정보의 구성은 [ Daum 가이드] ( http://postcode.map.daum.net/guide ) 를 참고해주세요. |
112112| onClose | ` function ` | ` undefined ` | 검색 결과를 선택하여, 서비스가 닫힐 때 실행되는 콜백함수입니다. |
Original file line number Diff line number Diff line change @@ -8,6 +8,14 @@ declare global {
88 } ;
99 Postcode : PostcodeConstructor ;
1010 } ;
11+ kakao ?: {
12+ postcode : {
13+ load : ( fn : ( ) => void ) => void ;
14+ version : string ;
15+ _validParam_ : boolean ;
16+ } ;
17+ Postcode : PostcodeConstructor ;
18+ } ;
1119 }
1220}
1321
@@ -124,10 +132,10 @@ export interface Postcode {
124132 embed ( element : HTMLElement , embedOptions ?: EmbedOptions ) : void ;
125133}
126134
127- export const postcodeScriptUrl = 'https://t1.daumcdn .net/mapjsapi/bundle/postcode/prod/postcode.v2.js' ;
135+ export const postcodeScriptUrl = 'https://t1.kakaocdn .net/mapjsapi/bundle/postcode/prod/postcode.v2.js' ;
128136
129137const loadPostcode = ( function ( ) {
130- const scriptId = 'daum_postcode_script ' ;
138+ const scriptId = 'kakao_postcode_script ' ;
131139 let promise : Promise < PostcodeConstructor > | null = null ;
132140
133141 return function ( url : string = postcodeScriptUrl ) : Promise < PostcodeConstructor > {
@@ -137,8 +145,9 @@ const loadPostcode = (function () {
137145 const script = document . createElement ( 'script' ) ;
138146 script . src = url ;
139147 script . onload = ( ) => {
140- if ( window ?. daum ?. Postcode ) {
141- return resolve ( window . daum . Postcode ) ;
148+ const PostcodeConstructor = window ?. kakao ?. Postcode ?? window ?. daum ?. Postcode ;
149+ if ( PostcodeConstructor ) {
150+ return resolve ( PostcodeConstructor ) ;
142151 }
143152 reject ( new Error ( 'Script is loaded successfully, but cannot find Postcode module. Check your scriptURL property.' ) ) ;
144153 } ;
You can’t perform that action at this time.
0 commit comments