Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
project-online-fi
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
project-online-fi
Commits
acdd5456
提交
acdd5456
authored
11月 18, 2022
作者:
matian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updates
上级
5f2df40d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
54 行增加
和
5 行删除
+54
-5
3.js
data/src/goods/3.js
+1
-1
CourseList.vue
src/modules/shop/components/CourseList.vue
+52
-3
Index.vue
src/modules/shop/views/Index.vue
+1
-1
没有找到文件。
data/src/goods/3.js
浏览文件 @
acdd5456
...
@@ -2,7 +2,7 @@ export default [
...
@@ -2,7 +2,7 @@ export default [
{
{
category
:
'PAAM'
,
category
:
'PAAM'
,
id
:
'3'
,
id
:
'3'
,
title
:
'PAA
P1
系列课程'
,
title
:
'PAA
M
系列课程'
,
desc
:
'通过私人权属资产全面预算的系统学习,具备完成私人资产分析所需要的系统源点知识的底层逻辑,精确盘点私人资产,建立私人资产分析的多维模型'
,
desc
:
'通过私人权属资产全面预算的系统学习,具备完成私人资产分析所需要的系统源点知识的底层逻辑,精确盘点私人资产,建立私人资产分析的多维模型'
,
for_people
:
'包括但并不仅限于金融保险企业绩优营销员'
,
for_people
:
'包括但并不仅限于金融保险企业绩优营销员'
,
image_url
:
''
,
image_url
:
''
,
...
...
src/modules/shop/components/CourseList.vue
浏览文件 @
acdd5456
...
@@ -8,19 +8,68 @@ const props = defineProps({
...
@@ -8,19 +8,68 @@ const props = defineProps({
type
:
String
type
:
String
}
}
})
})
const
courseListAll
=
computed
<
any
>
(()
=>
{
const
page
=
reactive
({
size
:
3
,
currentPage
:
1
})
const
courseListAll
=
$computed
<
any
>
(()
=>
{
if
(
props
.
type
)
{
if
(
props
.
type
)
{
return
props
.
courseList
?.
filter
((
item
:
any
)
=>
item
.
category
===
props
.
type
)
return
props
.
courseList
?.
filter
((
item
:
any
)
=>
item
.
category
===
props
.
type
)
}
else
{
}
else
{
return
props
.
courseList
return
props
.
courseList
}
}
})
})
watch
(
()
=>
courseListAll
,
()
=>
{
return
queryByPage
}
)
const
courseListAllNew
=
ref
([])
const
queryByPage
=
$computed
<
any
>
(()
=>
{
// 起始位置 = (当前页 - 1) x 每页的大小
const
start
=
(
page
.
currentPage
-
1
)
*
page
.
size
// 结束位置 = 当前页 x 每页的大小
const
end
=
page
.
currentPage
*
page
.
size
// 返回切割数组后的数据
return
courseListAll
.
slice
(
start
,
end
)
})
courseListAllNew
.
value
=
queryByPage
// 改变每页大小的方法
const
handleSizeChange
=
(
val
:
number
)
=>
{
page
.
size
=
val
// courseListAllNew.value = queryByPage
console
.
log
(
courseListAllNew
)
courseListAllNew
.
value
=
queryByPage
}
// 改变当前页的方法
const
handleCurrentChange
=
(
val
:
number
)
=>
{
page
.
currentPage
=
val
// courseListAllNew.value = queryByPage
console
.
log
(
courseListAllNew
)
courseListAllNew
.
value
=
queryByPage
}
</
script
>
</
script
>
<
template
>
<
template
>
<div
v-for=
"(item, i
d) in courseListAll"
:key=
"id
"
>
<div
v-for=
"(item, i
ndex) in courseListAllNew"
:key=
"index
"
>
<CourseListItem
:courseItem=
"item"
:key=
"
id
"
></CourseListItem>
<CourseListItem
:courseItem=
"item"
:key=
"
type
"
></CourseListItem>
</div>
</div>
<el-pagination
class=
"pagination"
layout=
"total, sizes, prev, pager, next, jumper"
:page-sizes=
"[3, 5, 10, 15, 20]"
:page-size=
"page.size"
:total=
"courseListAll.length"
v-model:currentPage=
"page.currentPage"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
v-if=
"courseListAll.length > 3"
>
</el-pagination>
</
template
>
</
template
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
src/modules/shop/views/Index.vue
浏览文件 @
acdd5456
...
@@ -21,7 +21,7 @@ const handleTabClick = (tab: any) => {
...
@@ -21,7 +21,7 @@ const handleTabClick = (tab: any) => {
<template
#
label
>
<template
#
label
>
{{
item
.
label
}}
{{
item
.
label
}}
</
template
>
</
template
>
<CourseList
:type=
"item.value"
:courseList=
"shopStore.shopList"
/>
<CourseList
:type=
"item.value"
:courseList=
"shopStore.shopList"
:key=
"index"
/>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
</div>
</div>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论