StaticFormLabel使用说明
项目运行
-
cnpm install 或 npm install cnpm使用教程
-
npm run dev (开发环境打包 port:8080)
-
npm run test (测试用例)
-
npm run build (生产环境打包)
参数
Props
{
"hidden": false, // 是否渲染 默认false
"lablText": '测试', // 左侧值
"defaultvalue": '测试测试测试', // 右边值
"isLink": true, //是否是链接,当这个参数不存在或者为false时,下边两个参数无效
"linkValue": "http://www.baidu.com", //当为链接时,链接地址
"selfJump": false //本页跳转还是新标签跳转
}
PropTypes
StaticFormLabel.propTypes = {
hidden: PropTypes.bool,
labelText: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]),
defaultValue: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
])
}
StaticFormLabel 调用方法
1.安装npm组件包
npm install @beisen/StaticFormLabel --save-dev
2.引用组件
import StaticFormLabel from "@beisen/StaticFormLabel"
3.传入参数
render () {
let data = {
"hidden": false, // 是否渲染 默认false
"lablText": '测试', // 左侧值
"defaultvalue": '测试测试测试', // 右边值
"isLink": true, //是否是链接,当这个参数不存在或者为false时,下边两个参数无效
"linkValue": "http://www.baidu.com", //当为链接时,链接地址
"selfJump": false //本页跳转还是新标签跳转
}
return (
<div>
<StaticFormLabel {...data}/>
</div>
)
}