我与vue和vue-bulma选项卡有这个奇怪的错误。TypeError:尝试使用vue-bulma-tabs时数据必须是字符串或缓冲区
Project is running at http://localhost:8081/
webpack output is served from /dist/
404s will fallback to /index.html
crypto.js:74
this._handle.update(data, encoding);
^
TypeError: Data must be a string or a buffer
at TypeError (native)
at Hash.update (crypto.js:74:16)
at HarmonyExportImportedSpecifierDependency.updateHash (/Users/esteban/Projects/experiments/example1/node_modules/webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js:144:8)
at /Users/esteban/Projects/experiments/example1/node_modules/webpack/lib/DependenciesBlock.js:33:5
at Array.forEach (native)
at NormalModule.DependenciesBlock.updateHash (/Users/esteban/Projects/experiments/example1/node_modules/webpack/lib/DependenciesBlock.js:32:20)
at NormalModule.Module.updateHash (/Users/esteban/Projects/experiments/example1/node_modules/webpack/lib/Module.js:162:41)
at NormalModule.updateHash (/Users/esteban/Projects/experiments/example1/node_modules/webpack/lib/NormalModule.js:327:30)
at modules.forEach.m (/Users/esteban/Projects/experiments/example1/node_modules/webpack/lib/Chunk.js:253:31)
at Array.forEach (native)
我认为是有关webpack,但我没有得到什么问题或如何解决它。
重现它,只是这样做
vue init webpack-simple example1
cd example1
npm i
npm i -S bulma vue-bulma-tabs
然后将其添加到main.js文件
import {Tabs, TabPane} from 'vue-bulma-tabs'
然后运行
npm run dev
等瞧!有错误。我错过了什么?
确实找不到它,但问题是vue-bulma-tabs包使用不带扩展名的vue文件加载,而使用vue cli创建的项目默认情况下不启用该选项。主要问题是无法导入的文件不在我的项目代码中,但是我正在加载一些软件包。 – mcniac
@carlous正是......这是根本原因 –
这是非常有益的,谢谢卡洛斯! –