适用faceEnum参数类型的组件设计

作为一个react组件,它将至少可以接收以下props:

propTypes = {
  token: String, //用户的token
  label: String, //此参数的标签
}

此组件的主要依赖为face3d-query项目,face3d-query项目将完成face3d集合相关信息的检索,上传,移除等任务。例如:

import {upload, findAll, init, find, remove} from 'face3d-query'

init(token, baseUrl)  //初始化face3d-query的请求token和请求的基本Url,例如http://test.tuocad.com/tuo-fair-backend

findAll().then(results => console.log(results)) //打印当前用户所有的face3d数据
find(id).then(result => console.log(result)) //打印当前用户所指定的face3d.id的数据
upload(data).then(result => console.log(result)) //打印上传当前数据的结果 {result: 'ok'}为成功, {result: 'error', msg: String} //为上传失败和失败原因
remove(id).then(result => console.log(result)) //打印移除指定数据的结果, 结果的格式与upload相同。

此组件将在合适的位置和时间,提供用户对face3d数据的查寻,移除和上传功能。

发表评论

邮箱地址不会被公开。 必填项已用*标注