We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用 vite 时,import() 不能使用绝对路径拼接,只能使用相对路径或者绝对路径字符串,希望修改导入相关代码,移除 '@/'+,并提示用户应该使用 '../'。该功能在 webpack 中可以正常使用。下面是例子:
import('@/dict.json') // 正常 import('../../dict.json') // 正常 var url = '../dict.json' import(url) // 正常 var url = '@/dict.json' import(url) // 报错 var url = 'dict.json' import(`@/${url}`) // 报错 import('@/' + url) // 报错 var url = 'dict.json' import('../../' + url) // 报错,但不是无法引用,而是 MIME 不正确 // 该案例使用了 js 而不是 json var url = 'dict.js' import('../../' + url) // 正常 // dict.js import baseDict from "./baseDict.json"; export default baseDict
参考资料:https://stackoverflow.com/questions/72845337/dynamic-import-of-component-does-not-work-with-component-path-from-variable
The text was updated successfully, but these errors were encountered:
另外,这个组件在 vite + vue3 项目下基本无法运行,不知道是不是可以在 vue-cli + vue 3 下运行?如果只能在 vue-cli + vue 3下运行的话,能否在介绍中标注出来?
Sorry, something went wrong.
No branches or pull requests
使用 vite 时,import() 不能使用绝对路径拼接,只能使用相对路径或者绝对路径字符串,希望修改导入相关代码,移除 '@/'+,并提示用户应该使用 '../'。该功能在 webpack 中可以正常使用。下面是例子:
参考资料:https://stackoverflow.com/questions/72845337/dynamic-import-of-component-does-not-work-with-component-path-from-variable
The text was updated successfully, but these errors were encountered: