【问题标题】:BootstrapVue component doesn't renderBootstrapVue 组件不呈现
【发布时间】:2021-03-14 10:15:26
【问题描述】:

我正在关注官方文档https://bootstrap-vue.org/docs浏览器部分,但是 BootstrapVue 组件没有按预期呈现。

html 文件如下:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>webapp</title>
    <!-- Load required Bootstrap and BootstrapVue CSS -->
    <link type="text/css" rel="stylesheet" href="//unpkg.com/bootstrap@4.6.0/dist/css/bootstrap.min.css" />
    <link type="text/css" rel="stylesheet" href="//unpkg.com/bootstrap-vue@2.21.2/dist/bootstrap-vue.min.css" />

    <!-- Load Vue followed by BootstrapVue -->
    <script src="//unpkg.com/vue@2.6.12/dist/vue.min.js"></script>
    <script src="//unpkg.com/bootstrap-vue@2.21.2/dist/bootstrap-vue.min.js"></script>

    <!-- Load the following for BootstrapVueIcons support -->
    <script src="//unpkg.com/bootstrap-vue@2.21.2/dist/bootstrap-vue-icons.min.js"></script>
</head>
    <body>
        <div>
            <h2>Example heading <b-badge>New</b-badge></h2>
        </div>
    </body>
</html>

我看到的是1 而不是2

为了使组件正确呈现,应该解决什么问题?

【问题讨论】:

    标签: bootstrap-vue


    【解决方案1】:

    问题已解决,我必须在某处添加以下代码(例如 main.js):

    new Vue(...).$mount("#div_where_vue_should_render")

    【讨论】:

      猜你喜欢
      • 2017-12-02
      • 2018-09-25
      • 1970-01-01
      • 2022-11-01
      • 2018-10-21
      • 2021-11-25
      • 2019-06-06
      • 2018-08-16
      • 2017-06-10
      相关资源
      最近更新 更多