test import

This commit is contained in:
ilya-bkv 2023-11-13 18:29:46 +03:00
parent a25255b02d
commit ecc1b8feec
3 changed files with 6 additions and 13 deletions

View File

@ -1,8 +1,8 @@
import { renderPage } from 'vike/server' import { renderPage } from 'vike/server'
// export const config = { export const config = {
// runtime: 'edge' runtime: 'edge'
// } }
export default async function handler(req, res) { export default async function handler(req, res) {
const { url, cookies } = req const { url, cookies } = req

View File

@ -1,6 +1,6 @@
import { createSignal, For, Show } from 'solid-js' import { For, Show } from 'solid-js'
import { Icon } from '../Icon' import { Icon } from '../Icon'
import { register } from 'swiper/element/bundle' import { register } from 'swiper/element'
import SwiperCore, { Manipulation, Navigation, Pagination } from 'swiper' import SwiperCore, { Manipulation, Navigation, Pagination } from 'swiper'
import { SwiperRef } from './swiper' import { SwiperRef } from './swiper'
import { clsx } from 'clsx' import { clsx } from 'clsx'
@ -18,14 +18,8 @@ register()
SwiperCore.use([Pagination, Navigation, Manipulation]) SwiperCore.use([Pagination, Navigation, Manipulation])
export const ArticleCardSwiper = (props: Props) => { export const ArticleCardSwiper = (props: Props) => {
const [slideIndex, setSlideIndex] = createSignal(0)
const mainSwipeRef: { current: SwiperRef } = { current: null } const mainSwipeRef: { current: SwiperRef } = { current: null }
const handleSlideChange = () => {
setSlideIndex(mainSwipeRef.current.swiper.activeIndex)
}
return ( return (
<div class={clsx(styles.Swiper, styles.articleMode, styles.ArticleCardSwiper)}> <div class={clsx(styles.Swiper, styles.articleMode, styles.ArticleCardSwiper)}>
<Show when={props.title}> <Show when={props.title}>
@ -38,7 +32,6 @@ export const ArticleCardSwiper = (props: Props) => {
ref={(el) => (mainSwipeRef.current = el)} ref={(el) => (mainSwipeRef.current = el)}
centered-slides={true} centered-slides={true}
observer={true} observer={true}
onSlideChange={handleSlideChange}
space-between={20} space-between={20}
breakpoints={{ breakpoints={{
576: { spaceBetween: 20, slidesPerView: 1.5 }, 576: { spaceBetween: 20, slidesPerView: 1.5 },

View File

@ -3,7 +3,7 @@ import { MediaItem, UploadedFile } from '../../../pages/types'
import { Icon } from '../Icon' import { Icon } from '../Icon'
import { Popover } from '../Popover' import { Popover } from '../Popover'
import { useLocalize } from '../../../context/localize' import { useLocalize } from '../../../context/localize'
import { register } from 'swiper/element/bundle' import { register } from 'swiper/element'
import { DropArea } from '../DropArea' import { DropArea } from '../DropArea'
import { createFileUploader } from '@solid-primitives/upload' import { createFileUploader } from '@solid-primitives/upload'
import SwiperCore, { Manipulation, Navigation, Pagination } from 'swiper' import SwiperCore, { Manipulation, Navigation, Pagination } from 'swiper'