SweetAlert2 + Socket.IO输入选项

问题描述

我想从套接获取inputoptions的数据,但是当我想在inputoptions中循环时,出现错误Uncaught SyntaxError:Unexpected token'。'

        function logIn() {
        const socket = io('ws://127.0.0.1:3000');

        socket.emit('getClients');
        socket.on('returnClients',function(clients){
            Swal.fire({
              title: 'Wybierz swoje konto',input: 'select',inputoptions: {
                    clients.forEach(function(client,index) {
                      client.dbid: client.nickname,}),},inputPlaceholder: 'Wybierz konto',showCancelButton: true,inputValidator: (value) => {
                return new Promise((resolve) => {
                  if (value === 'oranges') {
                    resolve()
                  } else {
                    resolve('You need to select oranges :)')
                  }
                })
              }
            });

        
        });

    }

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)