我使用onsen ui v1.3.14。
当我尝试使用ons.notification中的每个函数时,我会得到一个错误:
错误:undefined不是对象(正在评估"window.navigator.userAgent.match")isAndroid@file:///onsenui_all.min.js:18:8206
随后:
TypeError:undefined不是对象(正在评估"alertDialog.show")createAlertDialog onsenui_all.min.js:17:19361
代码很简单:
ons.notification.alert({
message: "Message.",
title: "Title",
buttonLabel: "OK"
});
我发现了问题。我有一个名为navigator的var。我只是以医生为例。这是一个糟糕的例子。它会导致与window.navigator.的名称冲突