小编Ekm*_*mek的帖子

JSX 中的多行 JavaScript?

是否可以在 JSX 中编写多行 js 代码?

return (
      <b>{
      const a = props.users.find((user) => user.id === post.userId)
      console.log(a) // I want to console.log
      return a
      }</b>
);
Run Code Online (Sandbox Code Playgroud)

jsx typescript reactjs tslint

6
推荐指数
1
解决办法
2859
查看次数

如何使用 twilio 通过 Whatsapp 发送本地存储的媒体文件.. Node JS Express

我需要将生成的 PDF 作为 Whatsapp 消息发送,但当我尝试读取我的文件时,它显示错误。

 easyinvoice.createInvoice(data, function(result) {
        //The response will contain a base64 encoded PDF file
        fs.writeFileSync("invoice.pdf", result.pdf, 'base64');
        var s = result.pdf;
        client.messages
            .create({
                mediaUrl: s,
                body: 'invoice',
                from: 'whatsapp:+somenumber',
                to: 'whatsapp:+somenumber'
            })
            .then(message => console.log(message.sid))
            .done();
    });
Run Code Online (Sandbox Code Playgroud)

javascript node.js twilio express twilio-api

1
推荐指数
1
解决办法
2051
查看次数

标签 统计

express ×1

javascript ×1

jsx ×1

node.js ×1

reactjs ×1

tslint ×1

twilio ×1

twilio-api ×1

typescript ×1