这可能是字体超赞的错误,Vue的错误或错字。我不确定。
问题在于,在现有的vue项目中安装新的vue-fontawesome会破坏它。我确实让它在一个新的vue-cli项目中工作。
我以前的情况有这种设置(仅供参考),并且可以正常工作:
"@fortawesome/fontawesome": "^1.1.8", "@fortawesome/fontawesome-free-brands": "^5.0.13", "@fortawesome/fontawesome-free-regular": "^5.0.13", "@fortawesome/fontawesome-free-solid": "^5.0.13", "@fortawesome/vue-fontawesome": "0.0.23",
现在,我的Package.json看起来像这样:
“依赖项”:{
"@fortawesome/fontawesome-svg-core": "^1.2.6", "@fortawesome/free-regular-svg-icons": "^5.4.1", "@fortawesome/free-solid-svg-icons": "^5.4.1", "@fortawesome/vue-fontawesome": "^0.1.1", "babel-polyfill": "^6.26.0", "babel-runtime": "^6.26.0", "es6-promise": "^4.2.4", "isomorphic-fetch": "^2.2.1", "vue": "^2.5.16", "vuedraggable": "^2.16.0", "vuex": "^3.0.1" },
“ devDependencies”:{
"babel-core": "^6.26.3", "babel-loader": "^7.1.4", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.7.0", "babel-preset-es2015": "^6.24.1", "css-loader": "^0.28.11", "eslint": "^4.19.1", "eslint-config-standard": "^11.0.0", "eslint-plugin-import": "^2.12.0", "eslint-plugin-node": "^6.0.1", "eslint-plugin-promise": "^3.8.0", "eslint-plugin-standard": "^3.1.0", "eslint-plugin-vue": "^4.5.0", "raw-loader": "^0.5.1", "style-loader": "^0.21.0", "vue-loader": "^15.2.1", "vue-style-loader": "^2.0.5", "vue-template-compiler": "^2.5.16", "webpack": "^4.9.1", "webpack-cli": "^2.1.4" }
如果我仅使用(在main.js中)导入库(一切仍未使用,尽管我也尝试使用它),一切都会中断:
从“ @ fortawesome / fontawesome-svg-core”导入{库}