2016-12-28 15 views
0
<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キット通知で画面の左下隅に通知が表示されます。 私は他の人にポジションができればそれは変わりませんpossible values.UIキット通知の問題

私は何か非常に愚かなことをする必要があります。どんな助けもありがとうございます。

答えて

1

メッセージ内のuikit notifyは文字列のみですが、おそらくdivを使用して残りの部分を取り除き、それを手伝ってください。

notifyコンポーネントにも独自のCSSがありますので、必ずそれを含めてください。

+0

私はそれを見逃している可能性がありますどのようによくわからない。ありがとう。 –