feat(frontend): 横スワイプでタブを切り替える機能 (#13011)
* (add) 横スワイプでタブを切り替える機能 * Change Changelog * y方向の移動が一定量を超えたらスワイプを中断するように * Update swipe distance thresholds * Remove console.log * adjust threshold * rename, use v-model * fix * Update MkHorizontalSwipe.vue Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> * use css module --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
		| @@ -7,32 +7,34 @@ SPDX-License-Identifier: AGPL-3.0-only | ||||
| <MkStickyContainer> | ||||
| 	<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template> | ||||
| 	<MkSpacer :contentMax="700"> | ||||
| 		<div v-if="tab === 'featured'"> | ||||
| 			<MkPagination v-slot="{items}" :pagination="featuredFlashsPagination"> | ||||
| 				<div class="_gaps_s"> | ||||
| 					<MkFlashPreview v-for="flash in items" :key="flash.id" :flash="flash"/> | ||||
| 				</div> | ||||
| 			</MkPagination> | ||||
| 		</div> | ||||
|  | ||||
| 		<div v-else-if="tab === 'my'"> | ||||
| 			<div class="_gaps"> | ||||
| 				<MkButton gradate rounded style="margin: 0 auto;" @click="create()"><i class="ti ti-plus"></i></MkButton> | ||||
| 				<MkPagination v-slot="{items}" :pagination="myFlashsPagination"> | ||||
| 		<MkHorizontalSwipe v-model:tab="tab" :tabs="headerTabs"> | ||||
| 			<div v-if="tab === 'featured'" key="featured"> | ||||
| 				<MkPagination v-slot="{items}" :pagination="featuredFlashsPagination"> | ||||
| 					<div class="_gaps_s"> | ||||
| 						<MkFlashPreview v-for="flash in items" :key="flash.id" :flash="flash"/> | ||||
| 					</div> | ||||
| 				</MkPagination> | ||||
| 			</div> | ||||
| 		</div> | ||||
|  | ||||
| 		<div v-else-if="tab === 'liked'"> | ||||
| 			<MkPagination v-slot="{items}" :pagination="likedFlashsPagination"> | ||||
| 				<div class="_gaps_s"> | ||||
| 					<MkFlashPreview v-for="like in items" :key="like.flash.id" :flash="like.flash"/> | ||||
| 			<div v-else-if="tab === 'my'" key="my"> | ||||
| 				<div class="_gaps"> | ||||
| 					<MkButton gradate rounded style="margin: 0 auto;" @click="create()"><i class="ti ti-plus"></i></MkButton> | ||||
| 					<MkPagination v-slot="{items}" :pagination="myFlashsPagination"> | ||||
| 						<div class="_gaps_s"> | ||||
| 							<MkFlashPreview v-for="flash in items" :key="flash.id" :flash="flash"/> | ||||
| 						</div> | ||||
| 					</MkPagination> | ||||
| 				</div> | ||||
| 			</MkPagination> | ||||
| 		</div> | ||||
| 			</div> | ||||
|  | ||||
| 			<div v-else-if="tab === 'liked'" key="liked"> | ||||
| 				<MkPagination v-slot="{items}" :pagination="likedFlashsPagination"> | ||||
| 					<div class="_gaps_s"> | ||||
| 						<MkFlashPreview v-for="like in items" :key="like.flash.id" :flash="like.flash"/> | ||||
| 					</div> | ||||
| 				</MkPagination> | ||||
| 			</div> | ||||
| 		</MkHorizontalSwipe> | ||||
| 	</MkSpacer> | ||||
| </MkStickyContainer> | ||||
| </template> | ||||
| @@ -42,6 +44,7 @@ import { computed, ref } from 'vue'; | ||||
| import MkFlashPreview from '@/components/MkFlashPreview.vue'; | ||||
| import MkPagination from '@/components/MkPagination.vue'; | ||||
| import MkButton from '@/components/MkButton.vue'; | ||||
| import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue'; | ||||
| import { i18n } from '@/i18n.js'; | ||||
| import { definePageMetadata } from '@/scripts/page-metadata.js'; | ||||
| import { useRouter } from '@/global/router/supplier.js'; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 かっこかり
					かっこかり