Methods And Props

Available Props

You can add props in simplert component, example :
1
<simplert :useRadius="true"
2
:useIcon="true"
3
ref="simplert">
4
</simplert>
Copied!
Attribute
Value Type
Default Value
Description
:useRadius
Boolean
true
Setting useRadius to true will make Simplert's message box and buttons have rounded corners
:useIcon
Boolean
true
true : will use SweatAlert icon based on type, false : not use icon
ref
String
-
child reference, read here

Available Methods

You can call available methods in simplert with this.$refs.simplert.someMethod(), example :
1
var obj = {
2
isShown: true,
3
title: 'test',
4
message: 'message',
5
type: 'success',
6
onClose: this.onClose
7
}
8
this.$refs.simplert.openSimplert(obj)
Copied!
Method Name
Parameter
Description
closeOverlay
-
close overlay and simplert (internal method : do not call)
justCloseSimplert
-
close simplert without fired onClose method
whenConfirm
-
fired onConfirm and close simplert popup
closeSimplert
-
close simplert popup
openSimplert
Object
open simplert popup with predifined object passed

Object Parameter Simplert

Property
Type - Default
Description
title
string - empty
Title of alert
message
string - empty
Message of alert
type
string - 'info'
Type of icon will used
customClass
string - empty
Adding extra class in parent simplert
customIconUrl
string - empty
Using custom icon instead of default
customCloseBtnText
string - empty
Using custom text in button close
customCloseBtnClass
string - empty
Change default class in button close
onClose
func - undefined
Function will fired when close button clicked
useConfirmBtn
boolean - false
Using two button with close and confirm
customConfirmBtnText
string - empty
Using custom text in button confirm
customConfirmBtnClass
string - empty
Change default class in button confirm
onConfirm
func - undefined
Function will fired when confirm button clicked
disableOverlayClick
string - empty
Prevent click overlay will close alert
hideAllButton
boolean - false
Hide both button close and confirm
onOpen
func - undefined
Function will fired when open alert
showXclose
boolean - false
Show X close button in right corner of alert
1
{
2
title: 'test', //string -- title alert
3
message: 'message', //string -- message alert
4
type: 'success', //string -- type : info (default), success, warning, error
5
customClass: '', //string -- custom class in simplert div
6
customIconUrl: '', //string -- custom url custom image icon
7
customCloseBtnText: '', //string -- close button text
8
customCloseBtnClass: '', //string -- custom class for close button
9
onClose: this.onClose, //function -- when close triggered
10
useConfirmBtn: false, //boolean -- using confirm button
11
customConfirmBtnText: '', //string -- confirm button text
12
customConfirmBtnClass: '', //string -- custom class for confirm button
13
onConfirm: this.onConfirm, //function -- when confirm button triggered
14
disableOverlayClick: false, //boolean -- set to true if you want disable overlay click function
15
hideAllButton: false, //boolean -- set to true if you want hide all button
16
onOpen: null, //function -- when simplert open will fire this method if available
17
showXclose: true //boolean -- show x close button
18
}
Copied!
vue2-simplert
Copyright © 2017 by Irfan Maulana
Last modified 3yr ago