npm install easi-courseframe1. 安装
```
npm install easi-courseframe --save
2. 使用
`
import CourseFrame from 'easi-courseframe';
const courseFrameParams = {
maxCourseNum: 10,
dialogTitle: '选择要分享的课件',
frameId: 'cTree-dialog',
targetCourseList: {},
closeFun: () => {
this.toggleCTreeNew(false);
},
getTargetCourseList: (data) => {
console.log(data)
},
fetchCourseList: (params, sucFun, failFun) => {
},
fetchSearchCourse: (params, sucFun, failFun) => {
},
}
`
1. 参数说明
参数 | 描述 | 类型 | 是否必须
--- | --- | --- | ---
maxCourseNum | 最大选择课件数量 | int | true
dialogTitle | 弹窗名称 | string | false
frameId | 弹窗id | string | false
targetCourseList | 默认已选中列表 | obj | false
closeFun | 弹窗关闭函数 | fun | true
getTargetCourseList | 获取已经选中列表 | fun | true
fetchCourseList | 获取一层所有课件列表 | fun | true
fetchSearchCourse | 搜索课件 | fun | true
4. getTargetCourseList(data) 函数说明
1. 传入函数参数
`
// data 为 obj 类型 key 为课件id value 为课件详情
{
'6a249e8f-d054-40e7-9573-c334bb691223': courseItem
}
`
5. fetchCourseList(params, sucFun, failFun) 函数说明
1. 传入函数参数说明
``
params = {
parentId: [string]
}
sunFun = function
failFun = function
2. sucFun(data) 传入参数说明
``
data = [courseItem1, courseItem2, ...]
6. fetchSearchCourse(params, sucFun, failFun) 函数说明
1. 传入函数参数说明
``
params = {
searchNameKey: [string]
}
sunFun = function
failFun = function
2. sucFun(data) 参数说明
```
data = [courseItem1, courseItem2, ...]