---
title: 事件编辑器
group:
  path: /Editor
  title: 编辑器项
---

## 按钮  


```jsx  
import React from 'react';  
import BasicEventsEditor from '@dndc/pudge-basic/es/basic-editor/events';

const data = {
  style: {
    color: '#fff',
    fontSize: 14,
    height: 40,
    borderRadius: [4, 4, 4, 4],
    hover: {
      color: '#fff',
    },
  },
  props: {
    text: '按钮',
    href: '',
    isPostForm: false,
    icon: {
      type: '',
    },
  },
  track: {
    click: '',
  },
  events: {}
}
const propValue =  {};

const config = {
  label:'事件',
  name: {
    click:'click'
  },
  group: {
    label: '事件',
    isOpen: true,
  },
}
export default () => {
  return <div id="pudge-proto-drawer-body" style={{position:'relative', height:500, overflow:'hidden'}}>
          <BasicEventsEditor config={config} node={data} propValue={propValue} />
    </div>
};  
```  

### 1.可配置style, 默认样式配置:  

属性 | 说明 |  类型  | 默认值 | 版本  
-|-|-|-|-  
width | 宽度 | strig | 200px | 1.0.0  
height | 高度 | strig | 44px | 1.0.0  
backgroundColor | 背景颜色 | strig | primaryColor(主题色) | 1.0.0  
borderWidth | 边框宽度 | strig | 1px | 1.0.0  
borderColor | 边框颜色 | strig | rgb(24, 144, 255) | 1.0.0  
color | 颜色 | strig | #fff | 1.0.0  
hoverColor | 鼠标聚焦颜色 | strig | #fff | 1.0.0  
activeColor | 鼠标点击颜色 | strig | #fff | 1.0.0  
fontSize | 字体带下 | strig | 16px | 1.0.0  

example  
```json  
 style: {  
      width: '200px',  
      backgroundColor: primaryColor,  
      borderWidth: '1px',  
      borderColor: 'rgb(24, 144, 255)',  
      color: '#fff',  
      margin: ['0px', '0px', '0px', '0px'],  
      hoverColor: '#fff',  
      activeColor: '#fff',  
      fontSize: '16px',  
      height: '44px',  
    }  
```  

 

### 2.默认数据配置:  
属性 | 说明 |  类型  | 默认值 | 版本  
-|-|-|-|-  
text | 文字 | strig | 按钮 | 1.0.0  
href | 链接 | strig |  | 1.0.0  

example  
```json  
 props: {  
      text: '按钮',  
      href: '',  
    }  
```  

### 3.事件API:  

属性 | 说明 |  类型  | 版本  
-|-|-|-|-  
onClick | 点击 | Fun | 1.0.0  