guoshilong
2023-03-22 e0f9517f4b60d253b46abb20feb15d23ebaf32bc
src/views/socket-demo.vue
@@ -3,7 +3,17 @@
    <h1>{{ msg }}</h1>
    <button @click="connect">连接</button>
    <button @click="disconnect">断开连接</button>
    <button @click="sendMessage">发送消息</button>
    <button @click="sendMessage">msg</button>
    <button @click="sendMessage2">msg2</button>
    <embed
        src="public/swf/党建工作.swf"
        wmode="opaque"
        width="1140"
        height="320"
        align="middle"
        type="application/x-shockwave-flash"
    >
  </div>
</template>
@@ -15,7 +25,7 @@
  data () {
    return {
      socketIoClient: null,
      msg: 'Welcome to Your Vue.js App'
      msg: 'Socket.io 测试页'
    }
  },
  methods: {
@@ -42,6 +52,9 @@
    },
    sendMessage(){
      this.socketIoClient.emit("msg","99999999999")
    },
    sendMessage2(){
      this.socketIoClient.emit("msg2","00000")
    }
  },
}