小编Joã*_*tor的帖子

Vue 2.6 在 Safari IOS 上无法正常工作

我有一个按钮,当单击/按下时将触发输入类型=文件上的click()并允许用户上传文件,它在每个平台上都可以正常工作,但有时我需要在打开上传之前发出请求窗口,当我需要发出请求时,它可以在除Safari/IOS Safarai之外的每个平台上工作,在Safari中发出请求并且我得到响应,但不会触发输入 click()。

\n

这是我的代码。

\n
  async handleClickUpload(origin: string) {\n    try {\n      this._setDocumentType({ origin });\n      const { code: documentCode } = this.currentDocument;\n\n      if (this._isDocumentBackVariant(documentCode)) {\n        await this._variantBackDocumentHandler();\n      }\n      this._handleUploadMethod();\n    } catch (e) {\n      console.error(e);\n    }\n  }\n
Run Code Online (Sandbox Code Playgroud)\n

在这里我提出请求并设置文档的变体,(它在 Safari 上工作正常

\n
  async _variantBackDocumentHandler() {\n    const { variation } = await this.getSpecificDocument("cnh_rg_frente");\n\n    console.error("Encontrou varia\xc3\xa7\xc3\xa3o", variation);\n    if (!variation) {\n      this._setDocumentType({ open: true });\n      throw new Error("Varia\xc3\xa7\xc3\xa3o n\xc3\xa3o encontrada");\n    }\n    this._setDocumentType({ variation …
Run Code Online (Sandbox Code Playgroud)

javascript safari mobile-safari vue.js vuejs2

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

标签 统计

javascript ×1

mobile-safari ×1

safari ×1

vue.js ×1

vuejs2 ×1