Vite 官方有 将资源引入为字符串 功能,在引入路径后加 ?raw 就可以导入文件为字符串。但是我实际测试在 uniapp 微信小程序环境下无效。导入还是路径。 import home from '/static/images/tab/home.svg?raw'; console.log(home);