我正在尝试使用 Pnotify 的按钮,但我无法让它们工作。问题是我将 Pnotify 与 requiredJS 和 Bower 一起使用(在骨干网内).. 我尝试了很多方法..
Pnotify 文档对此问题有评论:(https://github.com/sciactive/pnotify#using-pnotify-with-requirejs)这是示例:
requirejs(['pnotify', 'pnotify.nonblock', 'pnotify.desktop'], function(PNotify){
PNotify.desktop.permission();
new PNotify({
title: 'Desktop Notice',
text: 'If you\'ve given me permission, I\'ll appear as a desktop notification. If you haven\'t, I\'ll still appear as a regular PNotify notice.',
desktop: {
desktop: true
},
nonblock: {
nonblock: true
}
});
});
该示例对我有用,因此我根据需要对其进行了一些修改:
require(['pnotify', 'pnotify.buttons', 'pnotify.nonblock'], function(PNotify){
new PNotify({
title: title ,
text: msg,
type: classes,
delay: delay,
animation: 'fade',
opacity: .9,
nonblock: {
nonblock: true,
nonblock_opacity: .2
}
});
});
这样非阻塞消息是否可以正常工作并且桌面通知也可以(如果需要)但没有出现按钮......有人有类似的问题吗?任何的想法?找到解决方案会很棒。谢谢!
注意:我已经安装了所有 pnotify 的模块