vue.js - You may need an appropriate loader to handle this file type
本文介绍了vue.js - You may need an appropriate loader to handle this file type的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
我的路由里的组件全是动态加载的。之前没注意,现在看到有个警告,You may need an appropriate loader to handle this file type.虽然没有影响 但看着不爽。
component: resolve => require([`${item.component}`], resolve)
就会出现如下警告
就不会出现这个警告.
如果我取消掉下面这个代码,它就不会出现这个警告.
${item.component}
想知道怎么解决处理掉它
解决方案
单页路由我不知道为毛可以字符串变量不用拼接字符串就可以
但是多页入口不拼接就一直报啊报啊,报个不停的警告,看着就烦人!
最后无奈拼接字符串吧 component: resolve => require([
${item.component}.vue], resolve)
警告消失,后台添加组件的时候也不要加.vue了。这样解决问题了,导致我又要去改表单验证,后台验证!日了狗了!
代码格式化少了 · 符号 数字1前面那个小点号 `
这篇关于vue.js - You may need an appropriate loader to handle this file type的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文