Sheet Modal Vue Component
Sheet Modal is a special overlay type which is similar to Picker/Calendar’s overlay. Such modal allows to create custom picker overlays with custom content.
There are following components included:
- - sheet modal element
Sheet Modal Properties
Sheet Modal Events
- using its
- by passing
true
orfalse
to itsopened
prop - by clicking on Link or with relevant
sheet-open
property (to open it) andsheet-close
property to close it
Access To Sheet Modal Instance
You can access Sheet Modal initialized instance by accessing **.f7Sheet**
component’s property.
<script>
export default {
data() {
return {
},
methods: {
createSheet() {
const self = this;
const $ = self.$$;
// Create sheet modal
if (!self.sheet) {
self.sheet = self.$f7.sheet.create({
content: `
<div class="sheet-modal">
<div class="toolbar">
<div class="toolbar-inner justify-content-flex-end">
<a href="#" class="link sheet-close">Close</a>
</div>
</div>
<div class="sheet-modal-inner">
<div class="page-content">
<div class="block">
<p>This sheet modal was created dynamically</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse faucibus mauris leo, eu bibendum neque congue non. Ut leo mauris, eleifend eu commodo a, egestas ac urna. Maecenas in lacus faucibus, viverra ipsum pulvinar, molestie arcu. Etiam lacinia venenatis dignissim...</p>
</div>
</div>
</div>
`.trim(),
});
}
// Close inline sheet
if ($('.demo-sheet.modal-in').length > 0) self.$f7.sheet.close('.demo-sheet');
// Open it
self.sheet.open();
},
onPageBeforeOut() {
const self = this;
// Close opened sheets on page out
self.$f7.sheet.close();
},
onPageBeforeRemove() {
const self = this;
// Destroy sheet modal when page removed
if (self.sheet) self.sheet.destroy();
},
},