话不多说,看方法:

// 检查文件是否以规定的拓展名为结尾
        checkFile(name) {
            const reg = /(.txt|.html|.css|.js|.config|.json|.htm|.zip|.rar)$/;
            if (!reg.test(name)) {
                return false;
            } else {
                return true;
            }
        },

 

相关文章:

  • 2022-12-23
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-06-04
  • 2022-12-23
  • 2021-10-15
相关资源
相似解决方案