생계유지형 개발자 67

[vue] warning: component lists rendered with v-for should have explicit keys

v-for 지시자에 대한 vue컴파일러 경고 메세지 Module Warning (from ./node_modules/vue-loader/lib/loaders/templateLoader.js): (Emitted value instead of an instance of Error) : component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info. 콘솔에 위와 같이 Vue 컴파일러의 경고메세지가 나타난다면 v-for 지시자를 선언한 옆에 v-bind:key 또는 :key 지시자를 선언한다. (v-bind):key 지시자가 없어서 경고메세지 뜬 경우 (v-bin..

[vue] bootstrap-vue의 b-table 사용할 때 필드 사이즈 조정

b-table 컴포넌트 사용 시 필드마다 사이즈 조정하기 b-table이 보다 편리하게 테이블을 생성할 수 있도록 많은 옵션을 제공하지만, 별도로 컬럼사이즈를 조절할 수 있는 방법이 없다. 컬럼마다 style 바인딩 해주기에는 너무 번거롭고 테이블 수도 많아서 쉽지 않다. 그래서 나는 thClass를 활용하기로 했다. 테이블을 사용하는 화면에서 b-table 컴포넌트를 바로 사용하는게 아니라, Table.vue 라는 컴포넌트로 한번 더 감싸주었다. 소스코드는 다음과 같다. SomeServices.vue /*********************************************************** - w10 ~ w95 까지 5단위로 컬럼의 width길이 조절 가능하다. - fields 데이터..

[vue] 컴포넌트에서 watch() 사용하여 router 이동 감지하기

상위 컴포넌트에서 router path가 변경되어 하위 컴포넌트가 변경될 때 접근로그를 기록하기 위해서, 컴포넌트 내에서 router의 변경을 감지할 필요가 있었다. 상위 컴포넌트의 watch 함수에 $route를 정의함으로써 router-view가 변경될 때마다 감지할 수 있었다. watch: { $route(to, from) { // ..... } } - 상위 컴포넌트 : DefaultContainer - 하위 컴포넌트 : LoggingCenterContainer, LoggingCenterAccessLog, LoggingCenterActionLog router/index.js /* router/index.js */ const routes = { path: '/lc', component: Default..

[spring] application.yml에 정의한 값이 상수이며 0으로 시작할 때 @Value 형변환 오류

아래와 같이, application.yml 파일에 daemon.send_number라는 Property를 정의하고 Java 클래스에서 @Value 애노테이션을 사용해서 smsSendNumber 변수를 선언했다. application.yml daemon: send_number: 0317263623 #네이버 사내정보서비스 대표전화번호 SmsSender.java public class SmsSender { @Value("${daemon.send_number}") private String smsSendNumber; //... log.info("MEX API sender: {}", smsSendNumber); } 위의 코드에서 당연히 smsSendNumber 변수에 0317263623 라는 값이 들어가야 하는데..

[spring] 매번 까먹는 JUnit4 테스트케이스 클래스 생성

JUnit 테스트케이스 생성할 때 매번 클래스명 위에 붙여야 하는 애노테이션(@)이 많고 길어서 기억이 안 난다. 특히 @Autowired랑 properties 사용하려면 클래스와 파일을 선언해줘야 하는데 기억이 안나... JUnit 4 버전 기준으로 작성한다. import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner;..

[git] branch 삭제하기 (git branch -d / -D)

# 안전하게 로컬 브랜치 삭제 $ git branch -d The -d option stands for --delete, which would delete the local branch, only if you have already pushed and merged it with your remote branches. -d 옵션은 로컬 브랜치(Local branch) 에서 작업 후 원격 저장소(Remote branch)에 정상적으로 push 또는 merge된 로컬 브랜치를 삭제한다. 즉, 삭제하려는 브랜치에 Commit 이력이 있으나, 원격 저장소로 push 또는 merge되지 않은 로컬 브랜치는 삭제가 불가능하다. # 강제로 로컬 브랜치 삭제 $ git branch -D The -D option stan..

[error][spring] Error creating bean with name 'delegatingApplicationListener' defined in class path resource

인수받은 시스템의 소스코드를 열어봤는데 패키지 구조가 마음에 안들었다. 패키지 구조랑 클래스 위치를 변경하고 스프링부트를 실행했는데 Error handling failed (Error creating bean with name 'delegatingApplicationListener' defined in class path resource 라면서 아래와 같은 오류가 발생했다. 2019-12-04 11:51:10.343 WARN 9333 --- [main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframewo..