close-button

(Vue.js) modal close event

耗尽温柔 提交于 2021-02-10 14:20:44
问题 When I click on the outer area of ​​the modal, I want the same event as the close button of the modal. (Event that closes modal when clicking outside area of ​​modal) The current progress is that the modal is closed when the close modal button is clicked. Carousel.vue <template> <div> <div v-for="(item, index) in photos" :key="index"> <div @click="imgClick(item)" style="cursor:pointer;"> <img :src="item.thumbnail" /> </div> <Modal v-if='item.show' @close="item.show = false"> <div slot='body'>

Close button of MatDiaLog in Angular get error Cannot read property 'close' of null

别说谁变了你拦得住时间么 提交于 2019-12-11 02:25:44
问题 I want to create a component with multiple content project in angular 6. It might be This is the content I passed from the app.component.html : <popup> <button buttonTrigger mat-button><span >Open the popup!</span></button> <my-dialog-content content></my-dialog-content> </popup> This is the content of the popup.component.html <div (click)="openDialog()"><ng-content select="[buttonTrigger]" ></ng-content></div> <ng-template #dialogContent> <ng-content select="[content]"></ng-content> </ng