Yk *_*Poh 3 vue.js bootstrap-vue
我正在开发一个 Vue 应用程序。我在我的应用程序中使用了这个官方示例中的bootstrap-vue 导航栏。但是,当我在控制台中运行我的项目时,Vue 不断警告我有关<b-nav-brand>我已包含在我的main.js.
如果您有任何想法,这是我的设置。
错误:
[Vue 警告]:未知的自定义元素:-您
是否正确注册了组件?对于递归组件,请确保在
此处提供输入代码在此处输入代码的“名称”选项。
导航栏代码:
<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>
Run Code Online (Sandbox Code Playgroud)
主.JS:
Vue.use(BootstrapVue)
new Vue({
el: '#app',
router: router,
template: '<App/>',
store: store,
components: {
App
}
})
Run Code Online (Sandbox Code Playgroud)
因为它<b-navbar-brand>在文档中。
<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>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10843 次 |
| 最近记录: |