Browse Source

优化WS

master
ltlzx 4 years ago
parent
commit
80190076e3
  1. 1
      src/views/contract/handicap.vue
  2. 10
      src/views/contract/index.vue

1
src/views/contract/handicap.vue

@ -267,6 +267,7 @@ export default {
});
}
});
},
//
unLink(symbol) {

10
src/views/contract/index.vue

@ -130,6 +130,7 @@
:wsUrl="wsUrl"
:ws="ws"
class="mr-2"
ref="handicap"
/>
<!-- 交易 -->
<exchange-store
@ -263,6 +264,7 @@ export default {
this.ws.on("open", () => {
this.swapMarketList();
});
console.info(this.$refs)
},
//
mounted: function () {
@ -296,9 +298,15 @@ export default {
this.ws.on('close',()=>{
this.ws= new Socket(this.Globals.Server.Path.WS1),
console.log('链接关闭');
this.swapMarketList();
this.wsOpen();
})
},
wsOpen(){
this.ws.on("open", () => {
this.swapMarketList();
this.$refs.handicap.linkSocket()
});
},
//
getMarketList() {
Contract.getMarketList().then(res => {

Loading…
Cancel
Save