-
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.
feat: add
Redirection
component to the playground
- Loading branch information
1 parent
bff8bc3
commit f090bdb
Showing
4 changed files
with
47 additions
and
2 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
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
36 changes: 36 additions & 0 deletions
36
packages/_vue3-migration-test/src/x-modules/search/components/test-redirection.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,36 @@ | ||
<template> | ||
<SearchInput /> | ||
<Redirection | ||
#default="{ redirection, redirect, abortRedirect, isRedirecting, delayInSeconds }" | ||
class="redirection-container" | ||
:delayInSeconds="5" | ||
> | ||
<p>Your search matches a special place in our website. You are being redirected to:</p> | ||
<a @click="redirect" :href="redirection.url" data-test="redirection-link"> | ||
{{ redirection.url }} | ||
</a> | ||
<div class="x-flex x-gap-32"> | ||
<button @click="abortRedirect" class="">No, I'll stay here</button> | ||
<button @click="redirect" class="">Yes, redirect me</button> | ||
</div> | ||
<AutoProgressBar :isLoading="isRedirecting" :durationInSeconds="delayInSeconds" /> | ||
</Redirection> | ||
</template> | ||
|
||
<script setup> | ||
import Redirection from '../../../../../x-components/src/x-modules/search/components/redirection.vue'; | ||
import AutoProgressBar from '../../../../../x-components/src/components/auto-progress-bar.vue'; | ||
import SearchInput from '../../../../../x-components/src/x-modules/search-box/components/search-input.vue'; | ||
</script> | ||
|
||
<style> | ||
.redirection-container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
background-color: antiquewhite; | ||
width: fit-content; | ||
padding: 0 10px 10px 10px; | ||
margin-top: 15px; | ||
} | ||
</style> |