我正在使用 WebStorm 2017.2.4 和 webpack Vue.js 项目。我添加了bootstrap-vue.js到我的项目,并希望看到它的提示和组件支持。
但取而代之的是,我收到了“未知的 html 标签”警告。
顺便说一句:bootstrap-vue 在运行项目时按预期工作。
您对如何让它发挥作用有什么建议吗?
最佳答案
更新于 2019/07/30
PHPShtorm(WebStorm) 已更新至 2019.2,现在他们添加了对 vuejs 库的更好支持: https://blog.jetbrains.com/webstorm/2019/07/webstorm-2019-2/#development_with_vue 我刚刚测试过并且有效。
旧答案
我通过手动添加组件解决了这个问题。 根据:https://bootstrap-vue.js.org/docs/#individual-components-and-directives 我创建了新文件,例如bootstrap.js 然后全局注册需要的组件
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap-vue/dist/bootstrap-vue.css';
import Vue from 'vue';
import navbar from 'bootstrap-vue/es/components/navbar/navbar';
import container from 'bootstrap-vue/es/components/layout/container';
// ...
Vue.component('b-navbar', navbar);
Vue.component('b-container', container);
// ...
它在 phpstorm 2018.1 中对我有用
关于vue.js - WebStorm 中 Bootstrap-Vue.js 支持的未知 html 标签警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46241523/