有导入功能:import socketIO, { Server as SocketIOServer } from "socket.io";我想把它转换成const socketIO, { Server as SocketIOServer } = require("socket.io")但它是不工作的,什么将按类型格式在要求?`错误:TS1005 ','预期
import socketIO, { Server as SocketIOServer } from "socket.io";
const socketIO, { Server as SocketIOServer } = require("socket.io")
ojsjcaue1#
这是用下面的代码解决的:
const { Server: SocketIOServer, default: socketIO } = require("socket.io")
字符串
1条答案
按热度按时间ojsjcaue1#
这是用下面的代码解决的:
字符串