问题:
在封装 el-breadcrumb 标签文件中,导入 'path-to-regexp' 插件,运行时警告:"export 'default' (imported as 'pathToRegexp') was not found in 'path-to-regexp'
原因:
导入路径的方式不正确。
解决方法:
正确的导入方法:
import * as pathToRegexp from 'path-to-regexp'
在使用el-breadcrumb时遇到'path-to-regexp'插件导入错误,提示'default'(imported as 'pathToRegexp')未找到。问题根源在于导入路径不正确。解决方法是采用星号通配符导入,正确写法为:import * as pathToRegexp from 'path-to-regexp'。执行此修改后,警告应消除,恢复正常运行。
在封装 el-breadcrumb 标签文件中,导入 'path-to-regexp' 插件,运行时警告:"export 'default' (imported as 'pathToRegexp') was not found in 'path-to-regexp'

导入路径的方式不正确。
正确的导入方法:
import * as pathToRegexp from 'path-to-regexp'
4099
6143

被折叠的 条评论
为什么被折叠?