- Full-Stack Vue.js 2 and Laravel 5
- Anthony Gore
- 92字
- 2021-07-02 19:57:23
Closing
Users will need a way to close their modal and return to the main window. We'll overlay a button in the top-right corner that, when clicked, evaluates an expression to setmodalOpentofalse. Theshowclass on our wrapper p will consequentially be removed, which means the display CSS property will return tonone,thus removing the modal from the page.
index.html:
<p id="modal" v-bind:class="{ show : modalOpen }"> <button v-on:click="modalOpen = false" class="modal-close">
×
</button> <p class="modal-content"> <img src="sample/header.jpg"/> </p> </p>
style.css:
.modal-close { position: absolute; right: 0; top: 0; padding: 0px 28px 8px; font-size: 4em; width: auto; height: auto; background: transparent; border: 0; outline: none; color: #ffffff; z-index: 1000; font-weight: 100; line-height: 1; }
推薦閱讀
- PHP 7底層設(shè)計與源碼實現(xiàn)
- C和C++安全編碼(原書第2版)
- Designing Hyper-V Solutions
- SQL語言從入門到精通
- Python程序設(shè)計案例教程
- Visual FoxPro程序設(shè)計
- JAVA程序設(shè)計實驗教程
- Swift語言實戰(zhàn)精講
- Windows內(nèi)核編程
- Application Development with Swift
- Access數(shù)據(jù)庫應(yīng)用教程(2010版)
- Java EE實用教程
- 基于MATLAB的控制系統(tǒng)仿真及應(yīng)用
- Spring Boot從入門到實戰(zhàn)
- Java服務(wù)端研發(fā)知識圖譜