@beisen-cmps/icon-button

0.1.27 • Public • Published

icon-button使用说明

项目运行

  1. cnpm install 或 npm install cnpm使用教程

  2. npm run dev (开发环境打包 port:8080)

  3. npm run test (测试用例)

  4. npm run build (生产环境打包)

IconButton参数

{
  /** 按钮类型(string)。参数:
        1.默认:“default”
        2.弱化按钮:“weaken”
        3.连接按钮:“link”,将返回一个<a></a>
    */
  bsStyle: 'default',
    
  /** 是否激活 */
  active: false,
    
  /** 是否禁用 */
  disabled: false,
    
  /** 返回<a>的链接 */
  href: '',
    
  /** 返回<a>的title */
  title: '测试11',
    
  /** 点击按钮后的回调 */
  onClick: function(target,onClick,btnInfo) {
    console.log(target);  //输出e
    console.log(onClick); //输出true
    console.log(btnInfo); //输出this.state
  },

  /** 是否显示按钮 */
  hidden: false, //
    
  /** 按钮图标的className */
  iconName: "sys-icon-spread",
}

icon-button调用方法

1.安装npm组件包

npm install @beisen/icon-button --save-dev

2.引用组件

import IconButton from "@beisen/icon-button"
  1. 传入参数

该参数为上述参数,传入方式使用: {...参数}

{
  "bsStyle": "default"
    /**按钮类型(string)。参数:
                                    1.默认:“default”
                                    2.弱化按钮:“weaken”
                                    3.连接按钮:“link”,将返回一个<a></a>
                                **/
    ,
  "active": false //是否激活
    ,
  "disabled": false //是否禁用
    ,
  "href": "" //返回<a>的链接
    ,
  "title": "测试11" //返回<a>的title
    ,
  "onClick": function(target,onClick,btnInfo) {
    console.log(target);  //输出e
    console.log(onClick); //输出true
    console.log(btnInfo); //输出this.state
  },
  "hidden": false //是否显示按钮
    ,
  "iconName": "sys-icon-spread"
}

render () {
    return (
      <IconButton {...this.state.IconData} />
    )
  }

Package Sidebar

Install

npm i @beisen-cmps/icon-button

Weekly Downloads

7

Version

0.1.27

License

ISC

Unpacked Size

14.8 kB

Total Files

9

Last publish

Collaborators

  • beisencorp