([我认为Piyush现在必须已经解决了它,如果其他人也遇到相同的问题,则将其发布。)]
您需要导入liferay-notification js模块才能使用Liferay通知。例如:
<aui:script use="liferay-notification">
new Liferay.Notification({
closeable: true,
delay: {
hide: 3000,
show: 0,
},
duration: 500,
message: message,
title: 'Your success Message',
type: 'success'
//danger, warning and info also exists
}).render();
</aui:script>
另一种方法是:
<script type="text/javascript">
AUI().use('liferay-notification', function(A) {
new Liferay.Notification({
closeable: true,
delay: {
hide: 10000,
show: 0
},
duration: 500,
message: message,
render: true,
title: 'your success message',
type: 'success'
}).render('body');
});
</script>