修复:图书详情和课程详情无数据问题
This commit is contained in:
@@ -11,7 +11,12 @@
|
||||
|
||||
<!-- 子级分类 -->
|
||||
<view v-if="selectedTab && selectedTab.children && selectedTab.children.length > 0" class="sub-category-list">
|
||||
<view v-for="child in selectedTab.children" :key="child.id" :class="{'active': child.id === radio_category_id}" class="sub-category-child-item">{{ child.title }}</view>
|
||||
<view
|
||||
v-for="child in selectedTab.children"
|
||||
:key="child.id" :class="{'active': child.id === radio_category_id}"
|
||||
class="sub-category-child-item"
|
||||
@click="changeRadioCategoryId(child.id)"
|
||||
>{{ child.title }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 课程列表 -->
|
||||
@@ -86,6 +91,17 @@ const changeCategory = ({ name }: { name: number}) => {
|
||||
radio_category_id.value = selectedTab.value && selectedTab.value.children[0] && selectedTab.value.children[0].id || 0
|
||||
}
|
||||
|
||||
/**
|
||||
* 子级分类切换
|
||||
*/
|
||||
const changeRadioCategoryId = (id: number) => {
|
||||
radio_category_id.value = id
|
||||
// 重新加载分页数据
|
||||
paging.value && paging.value.reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 分类下的课程列表
|
||||
const courseList = ref<ICourse[]>([]) // 课程列表
|
||||
const selectedCategoryId = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user