---
title: 按钮
group:
  path: /Basic
  title: 基础组件
---

## 按钮  


```jsx  
import React from 'react';  
import { Button } from '@dndc/pudge-basic';
const ns_button = {
    props: { text: '日产' },
    style: { backgroundColor: '#c3002f', },
  };  
const ns_ghost_button = {
    props: { text: '日产-边框按钮' },
    style: {
      color: '#c3002f',
      borderColor: '#c3002f',
      borderWidth: [1, 1, 1, 1],
      borderStyle: 'solid',
      backgroundColor: 'transparent',
      hover: {
        color: '#c3002f',
        backgroundColor: 'transparent',
      },
    },
  };
  const ns_ghost_defatul_button = {
    props: { text: '日产-边框按钮' },
    style: {
      color: '#333',
      borderColor: '#333',
      borderWidth: [1, 1, 1, 1],
      borderStyle: 'solid',
      backgroundColor: 'transparent',
      hover: {
        color: '#fff',
        borderColor: '#c3002f',
        backgroundColor: '#c3002f',
      },
    },
  };
  const ns_icon_button = {
    props: {
      text: '日产-图标按钮',
      icon: { type: 'icon-weixin', position: 'right' },
    },
    style: {
      width: 160,
      color: '#333',
      borderColor: '#333',
      borderWidth: [1, 1, 1, 1],
      borderStyle: 'solid',
      backgroundColor: 'transparent',
      hover: {
        color: '#fff',
        borderColor: '#c3002f',
        backgroundColor: '#c3002f',
      },
    },
  };
  const vn_button = {
    props: { text: '启辰' },
    style: {
      backgroundColor: '#2a558d',
      hover: { backgroundColor: '#2a558d' },
    },
  };
  const vn_ghost_button = {
    props: { text: '启辰-边框按钮' },
    style: {
      color: '#2a558d',
      borderColor: '#2a558d',
      borderWidth: [1, 1, 1, 1],
      borderStyle: 'solid',
      backgroundColor: 'transparent',
      hover: {
        color: '#2a558d',
        backgroundColor: 'transparent',
      },
    },
  };
  const vn_ghost_defatul_button = {
    props: { text: '启辰-边框按钮' },
    style: {
      color: '#333',
      borderColor: '#333',
      borderWidth: [1, 1, 1, 1],
      borderStyle: 'solid',
      backgroundColor: 'transparent',
      hover: {
        color: '#fff',
        borderColor: '#2a558d',
        backgroundColor: '#2a558d',
      },
    },
  };
export default () => {
  return <div id="pudge-page">
     <div style={{ display: 'flex' }}>
          <Button data={ns_button} />
          <Button data={ns_ghost_button} />
          <Button data={ns_ghost_defatul_button} />
          <Button data={ns_icon_button} />
        </div>
        <div style={{ display: 'flex' }}>
          <Button data={vn_button} />
          <Button data={vn_ghost_button} />
          <Button data={vn_ghost_defatul_button} />
        </div>
  </div>
};  
```  

### 1.props配置:  
属性 | 说明 |  类型  | 默认值 | 版本  
-|-|-|-|-  
text | 文字 | strig | 按钮 | 1.0.0  
icon | 图标 | object |  | 1.0.0
link | 按钮跳转链接 | object |  | 1.0.0 

#### 2.props.icon配置:  
属性 | 说明 |  类型  | 默认值 | 版本  
-|-|-|-|-  
type | 图标类型 | strig | | 1.0.0  
position | 图标相对文字的位置 | left、auto、right选项 |  | 1.0.0

### 1.props.link:  
属性 | 说明 |  类型  | 默认值 | 版本  
-|-|-|-|-  
type | 图标类型 | strig | | 1.0.0  
position | 图标相对文字的位置 | left、auto、right选项 |  | 1.0.0


example  
```json  
"props": {
    "text": "急救员指南",
    "icon": {
      "type": "icon-download",
      "position": "right"
    },
    "link": {
      "href": "https://www.dongfeng-nissan.com.cn/-/media/Images/Nissan/Cars/sylphy-zero-emission/service/help.pdf?la=zh-CN&hash=85B8947069557112EBCAE76EAF5FC80B665A462E",
      "target": "_self"
    }
} 
```  