index.jsx 824 B

12345678910111213141516171819202122232425
  1. import React, { useState } from 'react';
  2. import { Popconfirm, Button, Switch } from '@douyinfe/semi-ui/';
  3. export default function Demo({}) {
  4. const [disabled, setDisabled] = useState(false);
  5. return (
  6. <div>
  7. <div style={{ padding: 100 }}>
  8. <Popconfirm
  9. disabled={disabled}
  10. position="bottomLeft"
  11. title="确定是否要保存此修改?"
  12. content="此修改将不可逆"
  13. >
  14. <Button>Save</Button>
  15. </Popconfirm>
  16. <div style={{ marginTop: 200 }}>
  17. <label>是否禁用</label>
  18. <Switch checked={disabled} onChange={v => setDisabled(v)} />
  19. </div>
  20. </div>
  21. </div>
  22. );
  23. }