tmiks-dataconverter
v1.0.1010
Published
Data converter
Downloads
2
Readme
dataconverter
Description
Tmiks dataconverter is a data model that is a converter for allocating front-end and back-end objects. It can convert server properties into its own defined data model,
Installation
- npm i tmiks-dataconverter
- yarn add tmiks-dataconverter
Instructions
- Model definition
const mode={
naem:'名称定义',
url:{
get:'api/getdata',
put:'api/update'
},
mode:{
id:'id'
name:'name',
dataList:'ArrData',
dataListMode:{
id:'id',
name:'name'
},
dataSet:'dataObject',
dataSetMode:{
id:'id',
name:'name'
}
}
}
- usage method
import dataconverter from 'tmiks-dataconverter'
const res=dataconverter(mode,param,[modeUrl,apiMethod],{message:true})
res.tx(res.data)
| attribute | Description | | ------------------- | -------------------------------------------------------------------------------------------- | | mode | data Model | | param | The data passed to the server must be consistent with the custom properties. | | [modeUrl,apiMethod] | The attribute defined by modelUrl, apiMethod, is the request method passed in to the server. | | message | Is message prompt enabled. |