0.1.1 • Published 7 years ago

react-popconfirm v0.1.1

Weekly downloads
34
License
MIT
Repository
github
Last release
7 years ago

react-popconfirm

version downloads MIT License

A popover confirm dialog for react, react-bootstrap and react-confirm are used with.

PopConfirm

Usage

// import first
import PopConfirm from 'react-popconfirm'


// call it!
/**
 * options: 
 *  {
 *    element,              // require
 *    confirmation,         // require
 *    placement = 'top',    // require
 *    okLabbel = '确定',     // optional
 *    cancelLabel = '取消',  // optional
 *    positionLeft,         // optional (auto calculate by element position and width,height)
 *    positionTop,          // optional (auto calculate by element position and width,height)
 *    width = 160,          // optional (default 160)
 *    height = 70           // optional (default 70)
 *    confirmationColor = '#e83f3f',  // optional (default '#e83f3f')
 *    okStyle = 'info',               // optional (default 'info', available: default|primary|success|info|warning|danger|link)
 *    cancelStyle = 'default'         // optional (default 'default', available: default|primary|success|info|warning|danger|link)
 *  }
 */
PopConfirm({
	confirmation:'Are you sure?',
	okLabbel: 'Yes',
	cancelLabel: 'No',
	placement:'top',
	element:target	// target is the element you clicked
  }).then(
  (result) => {
    // `proceed` callback
    console.log('proceed called');
    console.log(result);
  },
  (result) => {
    // `cancel` callback
    console.log('cancel called');
    console.log(result)
  }
)
// nothing will be called when `dismiss` is triggered.

Try example

cd example
npm install
npm run build
npm start

License

MIT

0.1.1

7 years ago

0.1.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago