티스토리 뷰
modal을 공통으로 사용하기 위해 가져왔다.
여기에서 slot을 이용하게 되는데
Modal.vue
<div class="modal-header">
<slot name="header">
default header
</slot>
</div>
<div class="modal-body">
<slot name="body">
default body
</slot>
</div>
<div class="modal-footer">
<slot name="footer">
default footer
<button class="modal-default-button" @click="$emit('close')">
OK
</button>
</slot>
</div>
Modal.vue 내부에는 이렇게 3개의 slot 태그가 있다.
값을 overwrite해서 사용할 수 있다.
<Modal v-if="showModal" @close="showModal = false">
<!--
you can use custom content here to overwrite
default content
-->
<template v-slot:header>
경고
</template>
</Modal>
해당 모달을 컴포넌트로 불러 올때에 <template v-slot:slot이름> 순으로 작성해서 가져오면
해당 헤더슬롯 부분이 경고로 변경된다.
'dev > vue.js' 카테고리의 다른 글
Es6 란? (0) | 2024.05.10 |
---|---|
트랜지션 클래스 넣기 (0) | 2024.05.10 |
q-tabs , store 만들어 쓰기 (0) | 2024.05.09 |
$emit (0) | 2024.05.09 |
localstorage 값 빼오기, v-for (0) | 2024.05.09 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- thymleaf
- rejectValue
- 백엔드 개발자 공부
- React
- ArgumentResolver
- 스프링부트
- reject
- 스프링공부
- jpa api
- 예외처리
- 컨트
- 항해플러스
- 향해플러스백엔드
- react실행
- 항해99
- 향해99
- SpringBoot
- 백엔드 개발자 역량
- exception
- hypertexttransferprotocol
- 로그인
- BindingResult
- 인터셉터
- Java
- HTTP
- Intercepter
- 향해플러스
- JPA
- filter
- 리터럴
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함