<template>
	<custom-scroll-list :refreshFn="getLianxiList" :tabList="tabData" :defaultTab="1" ref="scrollRef"
		placeholder="请输入练习名称">
		<template #default="{list}">
			<scroll-list-card-lianxi v-for="(item,index) in list" :key="item.lxId" :data="item"
				@btnClick="handleClick"></scroll-list-card-lianxi>
		</template>
	</custom-scroll-list>
</template>

<script setup>
	import scrollListCardLianxi from "@/components/score-lianxi-card-lianxi/score-lianxi-card-lianxi.vue"
	import {
		getLianxiList,
	} from "@/api/lianxi.js";
	import {
		ref
	} from "vue";


	const tabData = [{
			label: "开始练习",
			value: 1,
		},
		{
			label: "已结束",
			value: 2,
		}
	]

	function handleClick(data) {
		uni.redirectTo({
			url: `/pages/lianxi/lianxi?lxId=${data.lxId}`
		})
	}
</script>

<style lang="scss">

</style>