gpt4 book ai didi

vue.js - Bootstrap-Vue.JS 未知自定义元素

转载 作者:行者123 更新时间:2023-12-03 06:43:37 24 4
gpt4 key购买 nike

我正在开发一个 Vue 应用程序。我使用来自 this official example 的 bootstrap-vue 导航栏在我的应用程序中。但是,当我运行我的项目时,在控制台中,Vue 不断警告我未知的自定义元素 <b-nav-brand>我已将其包含在我的 main.js 中.

如果您有任何想法,这是我的设置。

错误:

[Vue warn]: Unknown custom element: - did you register
the component correctly? For recursive components, make sure to provide
enter code here enter code here the "name" option.



导航栏代码:
<b-navbar class="nav-bar" toggleable="sm">
<b-navbar-toggle target="nav_collapse"></b-navbar-toggle>
<b-nav-brand class="logo" href="#">
<img src="/static/images/boost-icon.svg" alt="Boost icon"/>
<h1>Portal</h1>
</b-nav-brand>
<b-collapse is-nav id="nav_collapse">
<b-navbar-nav class="ml-auto">
<b-nav-item href="">
<span class="btn btn-primary btn-request-access">Request Access</span>
</b-nav-item>
</b-navbar-nav>
</b-collapse>
</b-navbar>

主.JS:
Vue.use(BootstrapVue)
new Vue({
el: '#app',
router: router,
template: '<App/>',
store: store,
components: {
App
}
})

最佳答案

因为它的 <b-navbar-brand>docs .

<link type="text/css" rel="stylesheet" href="//unpkg.com/bootstrap/dist/css/bootstrap.min.css"/>
<link type="text/css" rel="stylesheet" href="//unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.css"/>

<script src="//unpkg.com/babel-polyfill@latest/dist/polyfill.min.js"></script>
<script src="//unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.js"></script>

<div>
<!-- Image and text -->
<b-navbar variant="faded" type="light">
<b-navbar-brand href="#">
<img src="https://placekitten.com/g/30/30" class="d-inline-block align-top" alt="BV">
BootstrapVue
</b-navbar-brand>
</b-navbar>
</div>

关于vue.js - Bootstrap-Vue.JS 未知自定义元素 <b-nav-brand>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51942015/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com