UI 套件通知 pos 问题
UI kit notify pos issue
<script>
$(function(){
var ws_scheme = window.location.protocol == "https:" ? "wss": "ws";
var ws_path = ws_scheme + "://" + window.location.host + "/dashboard";
console.log("Connecting to " + ws_path);
var socket = new ReconnectingWebSocket(ws_path);
socket.onmessage = function (message) {
// Decode the JSON
console.log("Got websocket message " + message.data);
var display = '<div class="uk-alert uk-alert-success">'+ message.data + "</div>";
console.log("Got websocket message " + display);
UIkit.notify({
message : display,
status : 'info',
timeout : 0,
pos : 'top-center'
});
}
});
</script>
对于以下代码片段,UI kit notify 在屏幕左下角显示通知。
如果我能定位到其他possible values.
,它不会改变
我一定是在做一些很傻的事情。感谢任何帮助。
uikit notify 中的消息仅为字符串,可能在内部使用 div 破坏了其余部分,请尝试从中生成 fiddle。
通知组件也有自己的css,一定要包含它。
<script>
$(function(){
var ws_scheme = window.location.protocol == "https:" ? "wss": "ws";
var ws_path = ws_scheme + "://" + window.location.host + "/dashboard";
console.log("Connecting to " + ws_path);
var socket = new ReconnectingWebSocket(ws_path);
socket.onmessage = function (message) {
// Decode the JSON
console.log("Got websocket message " + message.data);
var display = '<div class="uk-alert uk-alert-success">'+ message.data + "</div>";
console.log("Got websocket message " + display);
UIkit.notify({
message : display,
status : 'info',
timeout : 0,
pos : 'top-center'
});
}
});
</script>
对于以下代码片段,UI kit notify 在屏幕左下角显示通知。 如果我能定位到其他possible values.
,它不会改变我一定是在做一些很傻的事情。感谢任何帮助。
uikit notify 中的消息仅为字符串,可能在内部使用 div 破坏了其余部分,请尝试从中生成 fiddle。
通知组件也有自己的css,一定要包含它。