let webSocket = {
    $ws: null,
    init: function () {
        // this.$ws = new WebSocket("ws://192.168.0.105:8002/ws");
        this.$ws = new WebSocket("ws://lift.whlhcx.com:8002/ws");
        this.$ws.onopen = this.wsOpen;
        this.$ws.onclose = this.wsClose;
        this.$ws.onmessage = this.wsMessage;
        this.$ws.onerror = this.wsError;
    },
    wsOpen: function (e) {
        console.log('连接成功......')
    },
    wsClose: function (e) {
        console.log('连接关闭......')
    },
    wsError: function (e) {
        console.log('连接出现错误......')
    },
    wsMessage: function (e) {
        console.log('接受消息', e)
    },
    // sendMsg: function (data) {
    //     this.$ws.send(data);
    // }
}
export default webSocket



