| | |
| | | <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> |
| | | |
| | |
| | | data () { |
| | | return { |
| | | socketIoClient: null, |
| | | msg: 'Welcome to Your Vue.js App' |
| | | msg: 'Socket.io 测试页' |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | }, |
| | | sendMessage(){ |
| | | this.socketIoClient.emit("msg","99999999999") |
| | | }, |
| | | sendMessage2(){ |
| | | this.socketIoClient.emit("msg2","00000") |
| | | } |
| | | }, |
| | | } |