You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jwl-applet/src/pages/index/index.vue

58 lines
1.3 KiB

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