vue.js - WebStorm 中 Bootstrap-Vue.js 支持的未知 html 标签警告

标签 vue.js vuejs2 webstorm bootstrap-4

我正在使用 WebStorm 2017.2.4 和 webpack Vue.js 项目。我添加了bootstrap-vue.js到我的项目,并希望看到它的提示和组件支持。

但取而代之的是,我收到了“未知的 html 标签”警告。

screen

顺便说一句:bootstrap-vue 在运行项目时按预期工作。

您对如何让它发挥作用有什么建议吗?

最佳答案

更新于 2019/07/30

PHPShtorm(WebStorm) 已更新至 2019.2,现在他们添加了对 vuejs 库的更好支持: https://blog.jetbrains.com/webstorm/2019/07/webstorm-2019-2/#development_with_vue 我刚刚测试过并且有效。 enter image description here

旧答案

我通过手动添加组件解决了这个问题。 根据: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/

相关文章:

vue.js - 如何禁用 Vue 转换组等待浏览器选项卡被选择?

javascript - 从父组件到子组件的事件

javascript - 如何在VueJS中传递props?

parameters - Vue Router - 未传递参数

macos - Intellij-idea:字母键的自动重复

javascript - 我的链式 POST 和 GET axios 调用变慢是很自然的吗?

javascript - 来自 API 的 Vue 多选选项

javascript - 调试 Node.js 应用程序时,WebStorm 在错误的文件上停止

angular - 禁止在 Nrwl Nx 中的同一库中导入桶文件

vue.js - Vue路由器中的确切路径匹配?