继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Google Doc 更新一个文档 替换多个变量

拿我格子衫来
关注TA
已关注
手记 22
粉丝 3
获赞 41
gapi.client.request({
        method: 'POST',
        path: `https://docs.googleapis.com/v1/documents/${docId}:batchUpdate`,
        body: {
          requests: [
            {
              replaceAllText: {
                replaceText: '蓑笠翁',
                containsText: {
                  text: '${oldMan}',
                  matchCase:true
                }
              }
            },
            {
              replaceAllText: {
                replaceText: '雪',
                containsText: {
                  text: '${snow}',
                  matchCase:true
                }
              }
            }
          ]
        }
      }).then(res => {
        printLog(`更新文档成功`, 'text-success')
        console.log(res)
        downLoadDocFile(res.result.documentId)
      })
打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP