refactor: remove uneended ref
This commit is contained in:
parent
8f7a18301c
commit
d2f0865e3e
|
|
@ -1,14 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Autoplay from 'embla-carousel-autoplay'
|
import Autoplay from 'embla-carousel-autoplay'
|
||||||
import { ref } from 'vue'
|
|
||||||
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from '@/lib/registry/default/ui/carousel'
|
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from '@/lib/registry/default/ui/carousel'
|
||||||
import { Card, CardContent } from '@/lib/registry/default/ui/card'
|
import { Card, CardContent } from '@/lib/registry/default/ui/card'
|
||||||
|
|
||||||
const plugin = ref(Autoplay({
|
const plugin = Autoplay({
|
||||||
delay: 2000,
|
delay: 2000,
|
||||||
stopOnMouseEnter: true,
|
stopOnMouseEnter: true,
|
||||||
stopOnInteraction: false,
|
stopOnInteraction: false,
|
||||||
}))
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -17,7 +16,7 @@ const plugin = ref(Autoplay({
|
||||||
class="w-full max-w-xs"
|
class="w-full max-w-xs"
|
||||||
:plugins="[plugin]"
|
:plugins="[plugin]"
|
||||||
@mouseenter="plugin.stop"
|
@mouseenter="plugin.stop"
|
||||||
@mouseleave="[plugin.reset(), plugin.play(), console.log('Rungin')];"
|
@mouseleave="[plugin.reset(), plugin.play(), console.log('Runing')];"
|
||||||
>
|
>
|
||||||
<CarouselContent>
|
<CarouselContent>
|
||||||
<CarouselItem v-for="(_, index) in 5" :key="index">
|
<CarouselItem v-for="(_, index) in 5" :key="index">
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Autoplay from 'embla-carousel-autoplay'
|
import Autoplay from 'embla-carousel-autoplay'
|
||||||
import { ref } from 'vue'
|
|
||||||
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from '@/lib/registry/new-york/ui/carousel'
|
import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from '@/lib/registry/new-york/ui/carousel'
|
||||||
import { Card, CardContent } from '@/lib/registry/new-york/ui/card'
|
import { Card, CardContent } from '@/lib/registry/new-york/ui/card'
|
||||||
|
|
||||||
const plugin = ref(Autoplay({
|
const plugin = Autoplay({
|
||||||
delay: 2000,
|
delay: 2000,
|
||||||
stopOnMouseEnter: true,
|
stopOnMouseEnter: true,
|
||||||
stopOnInteraction: false,
|
stopOnInteraction: false,
|
||||||
}))
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -17,7 +16,7 @@ const plugin = ref(Autoplay({
|
||||||
class="w-full max-w-xs"
|
class="w-full max-w-xs"
|
||||||
:plugins="[plugin]"
|
:plugins="[plugin]"
|
||||||
@mouseenter="plugin.stop"
|
@mouseenter="plugin.stop"
|
||||||
@mouseleave="[plugin.reset(), plugin.play(), console.log('Rungin')];"
|
@mouseleave="[plugin.reset(), plugin.play(), console.log('Runing')];"
|
||||||
>
|
>
|
||||||
<CarouselContent>
|
<CarouselContent>
|
||||||
<CarouselItem v-for="(_, index) in 5" :key="index">
|
<CarouselItem v-for="(_, index) in 5" :key="index">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user