ByteNote LogoByteNote

Navigation

  • Blog
  • 工具

    © 2025 ByteNote. All rights reserved.

    Vue 下载文件

    Dec 15, 202110 min read

    Vue 下载文件

     downFilePromise (fileName, content, fileType) {
          let fileContent = new Blob([content], {type: fileType})
          let url = window.URL.createObjectURL(fileContent)
          let link = document.createElement('a')
          link.style.display = 'none'
          link.href = url
          link.setAttribute('download', fileName)
          document.body.appendChild(link)
          link.click()
        },
    

    相关文章

    狂心若歇 歇即菩提

    当欲望过热时,停下来冷静以寻求内心的平和与智慧。

    next.js增加页面加载进度条

    在Next.js项目中通过安装`@badrap/bar-of-progress`依赖并配置`_app.js`文件,实现了页面加载进度条的功能。

    笔记本硬盘怎么买?

    购买笔记本硬盘时,应根据存储需求选择合适的容量和类型(HDD或SSD),考虑品牌、接口兼容性,参考评价和价格,选择购买渠道并完成支付。

    Chrom extension 如何监听 tab 关闭? 并提醒用户

    通过在 Chrome 扩展的 manifest.json 文件中声明 tabs 和 notifications 权限,并在 background.js 中监听 tabs.onRemoved 事件,可以在所有标签页关闭时弹出通知提醒用户。

    Flutter webview加载时显示进度

    Flutter应用中使用WebView加载网页时,通过状态管理显示加载进度。