【问题标题】:likert scale toggle effect missing-Bootstrap with Blaze MeteorLikert 比例切换效果缺失-带有 Blaze Meteor 的 Bootstrap
【发布时间】:2020-01-13 18:06:51
【问题描述】:

我有以下显示比例 1-5 的 html,我得到了被点击的值,但似乎在点击数字时它不会切换或改变颜色,它只会临时改变颜色,如附件中所示

<div class="row">
    <div class="btn-toolbar mr-2" role="toolbar" aria-label="Toolbar with button groups">
        <div class="btn-group" role="group" aria-label="likert group">
            <div class="btn-group btn-group-toggle mr-2" data-toggle="buttons">
                <a class="btn btn-link disabled ml-5" disabled>Totally Not</a>
                    <label class="btn btn-success" >
                        <input type="radio" name="likert" value="1" autocomplete="off">1
                    </label>
                    <label class="btn btn-success ">
                        <input type="radio" name="likert" value="2" autocomplete="off">2
                    </label>
                    <label class="btn btn-success ">
                        <input type="radio" name="likert" value="3" autocomplete="off">3
                    </label>
                    <label class="btn btn-success ">
                        <input type="radio" name="likert" value="4" autocomplete="off">4
                    </label>
                    <label class="btn btn-success ">
                        <input type="radio" name="likert" value="5" autocomplete="off">5
                    </label>
                <a class="btn btn-link disabled" disabled>Very Much</a>
            </div>
        </div>
    </div>
</div>

如何让它在被选中后保持切换效果?上面的代码有什么遗漏吗? (我在 Bootstrap 4 中使用 Meteor Blaze 框架)

【问题讨论】:

  • 您需要将选择存储在反应变量中。

标签: javascript meteor bootstrap-4 toggle meteor-blaze


【解决方案1】:

解决方案是在meteor js文件中添加以下npm模块的javascript文件

import 'bootstrap/dist/js/bootstrap.bundle'

【讨论】:

    猜你喜欢
    • 2021-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-27
    • 1970-01-01
    • 2017-07-09
    相关资源
    最近更新 更多