【问题标题】:How to store the variable value in bootstrap tag in meteor如何将变量值存储在流星的引导标签中
【发布时间】:2015-07-31 04:37:41
【问题描述】:

如何将变量值存储在bootstrap标签中 流星。

例如:

input type="text" value="Amsterdam,Washington,Sydney,Beijing,Cairo" data-role="tagsinput"

http://timschlechter.github.io/bootstrap-tagsinput/examples/

【问题讨论】:

    标签: twitter-bootstrap input meteor tags


    【解决方案1】:

    如果您还没有安装引导程序:

    meteor add twbs:bootstrap
    

    然后你安装你询问的包:

    meteor add ajduke:bootstrap-tagsinput
    

    然后大概在你的模板中:

    <template name="myFabTemplate">
        <section>
            <input type="text" value="{{getStuff}}" data-role="tagsinput">
        </section>
    </template>
    

    在你的模板助手中:

    Template.myFabTemplate.helpers({
        getStuff: function(){
            return "Amsterdam,Washington,Sydney,Beijing,Cairo";
        }
    });
    

    我在这里做了一个 MeteorPad 工作示例: http://meteorpad.com/pad/g4ArirBFKNdhbkbx5/tagsinput

    【讨论】:

    • 感谢您的回复....实际上我想从客户端将值存储在数据库中。存储在 db 中的事件是什么。
    • 我的问题已经解决了.."点击按钮": function(e, t) { for (j=1;j
    猜你喜欢
    • 2014-04-23
    • 1970-01-01
    • 2015-05-21
    • 1970-01-01
    • 2021-11-06
    • 1970-01-01
    • 2018-04-11
    • 1970-01-01
    • 2019-10-11
    相关资源
    最近更新 更多