Skip to content

Commit

Permalink
Alert Plugin: Support string-options
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Sep 19, 2016
1 parent 9a0ab8b commit f9fa59e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/alert/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export default {
$vm.$el.querySelector('.weui_dialog_bd').innerHTML = options['content']
}
}
} else if (typeof options === 'string') {
$vm.$el.querySelector('.weui_dialog_bd').innerHTML = options
}
if (options.onShow || options.onHide) {
if (typeof options === 'object' && (options.onShow || options.onHide)) {
watcher = $vm.$watch('show', (val) => {
val && options.onShow && options.onShow($vm)
val === false && options.onHide && options.onHide($vm)
Expand Down

0 comments on commit f9fa59e

Please sign in to comment.