-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1499 from empathyco/feature/migrate-base-events-m…
…odal-component-to-composition-api feat: migrate BaseEventsModal to composition API
- Loading branch information
Showing
4 changed files
with
156 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/_vue3-migration-test/src/components/modals/test-base-events-modal.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<template> | ||
<div class="base-modal"> | ||
<button @click="openModal">Open modal</button> | ||
<BaseEventsModal | ||
:animation="Fade" | ||
:focusOnOpen="true" | ||
v-bind="$attrs" | ||
contentClass="content" | ||
overlayClass="overlay" | ||
> | ||
<h1>Hello</h1> | ||
<p>The modal is working with events!!</p> | ||
<button @click="closeModal">Close modal</button> | ||
</BaseEventsModal> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import BaseEventsModal from '../../../../x-components/src/components/modals/base-events-modal.vue'; | ||
import Fade from '../../../../x-components/src/components/animations/fade.vue'; | ||
import { use$x } from '../../../../x-components/src/composables/use-$x'; | ||
const _$x = use$x(); | ||
const openModal = () => _$x.emit('UserClickedOpenEventsModal'); | ||
const closeModal = () => _$x.emit('UserClickedCloseEventsModal'); | ||
</script> | ||
|
||
<style> | ||
.base-modal { | ||
.content { | ||
background: white; | ||
margin: auto; | ||
width: 50%; | ||
border: 3px solid green; | ||
padding: 10px; | ||
} | ||
.overlay { | ||
background-color: #00ff80; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters