Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boco-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
idatt2106_2022_02
boco-frontend
Commits
f4ce4dff
Commit
f4ce4dff
authored
2 years ago
by
Sander August Heggland Schrader
Browse files
Options
Downloads
Patches
Plain Diff
Added image carousel component
parent
0be16df6
No related branches found
Branches containing commit
No related tags found
1 merge request
!81
Renting
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/RentingComponents/ImageCarousel.vue
+71
-0
71 additions, 0 deletions
src/components/RentingComponents/ImageCarousel.vue
with
71 additions
and
0 deletions
src/components/RentingComponents/ImageCarousel.vue
0 → 100644
+
71
−
0
View file @
f4ce4dff
<
template
>
<div
id=
"carouselExampleIndicators"
class=
"carousel slide relative"
data-bs-ride=
"carousel"
>
<div
class=
"carousel-indicators absolute right-0 bottom-0 left-0 flex justify-center p-0 mb-4"
>
<button
v-for=
"(image, i) in images"
:key=
"i"
type=
"button"
data-bs-target=
"#carouselExampleIndicators"
:data-bs-slide-to=
"i"
:class=
"
{'active': i === 0}"
:aria-current="i === 0 ? 'true' : 'false'"
:aria-label="'Slide ' + (i+1)"
>
</button>
</div>
<div
class=
"carousel-inner relative w-full overflow-hidden"
>
<div
v-for=
"(image, i) in images"
:key=
"i"
:class=
"'carousel-item float-left w-full'+ (i == 0 ? ' active' : '')"
>
<img
:src=
"image.src"
class=
"block w-full"
:alt=
"image.alt"
/>
</div>
</div>
<button
class=
"carousel-control-prev absolute top-0 bottom-0 flex items-center justify-center p-0 text-center border-0 hover:outline-none hover:no-underline focus:outline-none focus:no-underline left-0"
type=
"button"
data-bs-target=
"#carouselExampleIndicators"
data-bs-slide=
"prev"
>
<span
class=
"carousel-control-prev-icon inline-block bg-no-repeat"
aria-hidden=
"true"
></span>
<span
class=
"visually-hidden"
>
Previous
</span>
</button>
<button
class=
"carousel-control-next absolute top-0 bottom-0 flex items-center justify-center p-0 text-center border-0 hover:outline-none hover:no-underline focus:outline-none focus:no-underline right-0"
type=
"button"
data-bs-target=
"#carouselExampleIndicators"
data-bs-slide=
"next"
>
<span
class=
"carousel-control-next-icon inline-block bg-no-repeat"
aria-hidden=
"true"
></span>
<span
class=
"visually-hidden"
>
Next
</span>
</button>
</div>
</
template
>
<
script
>
/*
{
src: "imageURL",
alt: "IMAGE ALT TEXT"
}
*/
import
'
tw-elements
'
;
export
default
{
props
:
{
images
:
{
type
:
Array
,
required
:
true
,
},
},
data
()
{
return
{
}
}
}
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment