<template>
	<view>
		  <u-sticky bgColor="#fff">
		    <u-tabs :list="categoryList" :scrollable="false" @click="changeCategory"></u-tabs>
		  </u-sticky>
			<view style="height: 100vh;background-color: rgb(245, 245, 245);">
				<template v-if="tIndex===0 || tIndex===3">
					 <Subject1 :type="tIndex+1" />
				</template>
				<template v-else>
					<subject2 />
				</template>
			</view>
			</view>
</template>
<script>
	import { mapState,mapActions } from 'pinia' //引入映射函数
	import useQuestionStore from '@/jtools/store/question' //引入store
	import storage from '@/jtools/storage';
	import Subject1 from "./components/Subject1";
	import Subject2 from "./components/Subject2";
  export default {
    components: {Subject1,Subject2},
    data() {
			return {
				tIndex:0,
				searchValue:'',
				cityName:'',
				categoryList:[{
					name:'科目1'
				},{
					name:'科目2'
				},{
					name:'科目3'
				},{
					name:'科目4'
				}]
			};
		},
	 onLoad() {
	 },
	 methods:{
		 //切换科目
		 changeCategory(val){
			 this.tIndex=val.index
			 console.log(this.tIndex);
		 },
		}
	}
</script>

<style lang="scss" scoped>
::v-deep .u-tabs__wrapper__nav__line {
		background: linear-gradient(90deg, #11DF20 0%, #00B74F 100%) !important;
		bottom: 14rpx !important;
	}
</style>
