<script>
import io from 'static/weapp.socket.io.js';
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
this.socketopen()
},
methods: {
// 创建socket连接
async socketopen(){
console.log('创建socket连接');
var socket = io('wss://yuke.chat.yukevip.club/', { transports: ['websocket'] })
this.Socket = socket
},
}
}
</script>
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。