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

## 弹出按钮

```jsx
import React,{ useState } from 'react';
import { Card } from 'antd';
import { PopButton } from '@dndc/pudge-basic';
import CloseButtonEditor from '@dndc/pudge-basic/es/pop-button/editor/form/close-button';

const config = {
  name: {
      closeModel: 'closeModel',
    },
};

const props = { 
  text: '按钮', 
  href: '', 
  popicon: {
    type: 'icon-guanbi',
    fontSize: 28,
  } 
};
const style = {
  width: 180,
  backgroundColor: '',
  borderWidth: [1, 1, 1, 1],
  borderColor: '#000',
  borderStyle: 'solid',
  color: '#000',
  fontSize: 15,
  height: 44,
  borderRadius: [2, 2, 2, 2],
  hover: {
    backgroundColor: 'red',
    color: '#fff',
  },
};
const node = {
  props,
  style,
};
export default () => {
  const [data, setData] = useState(node);

  const onChangePathValue = ({path, value})=>{
    const props = {...data.props, [path]:value };
    setData({...data,props })
  };

   return (
    <div>
      <Card hoverable title="关闭按钮模板" >
        <CloseButtonEditor node={node} propKey='props' config={config} onChangePathValue={onChangePathValue} />
      </Card>

       <Card hoverable title="组件" >
         <PopButton data={data} />
      </Card>
    </div>
   );
} 
```


