Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(animation-factory): fix Vue3 breaking changes #1579

Merged
merged 4 commits into from
Aug 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(animation-factory): await animation to load
victorcg88 committed Jul 31, 2024
commit 5dbaeecc493d9aa35fbe1e00ec7fd972261a8f1f
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
</template>

<script setup lang="ts">
import { ref, shallowRef } from 'vue';
import { nextTick, ref, shallowRef } from 'vue';
import BaseModal from '../../../../x-components/src/components/modals/base-modal.vue';
import { animateClipPath } from '../../../../x-components/src/components/animations/animate-clip-path/animate-clip-path.factory';
import { animateScale } from '../../../../x-components/src/components/animations/animate-scale/animate-scale.factory';
@@ -29,24 +29,27 @@
const scaleAnimation = animateScale('bottom');
const translateAnimation = animateTranslate('right');

const currentAnimation = shallowRef(clipPathAnimation);
const currentAnimation = shallowRef(scaleAnimation);
const open = ref(false);

/** Open modal with ClipPath animation. */
function openWithClipPath() {
async function openWithClipPath() {
currentAnimation.value = clipPathAnimation;
await nextTick();
open.value = true;
}

/** Open modal with Scale animation. */
function openWithScale() {
async function openWithScale() {
currentAnimation.value = scaleAnimation;
await nextTick();
open.value = true;
}

/** Open modal with Translate animation. */
function openWithTranslate() {
async function openWithTranslate() {
currentAnimation.value = translateAnimation;
await nextTick();
open.value = true;
}
</script>