【问题标题】:Meteor Autoform Select2 set valueMeteor Autoform Select2 设定值
【发布时间】:2015-10-22 09:30:52
【问题描述】:

我正在使用 Meteor autoform select2 包,并试图弄清楚如何设置选定的值。目前正在尝试以下但我看不到其他国家/地区列表

options: function () {
    var user = Meteor.users.findOne();
    if (user && !_.isEmpty(user.profile.country)) {
        return {value: user.profile.country};
    }

    return countriesList;
}

【问题讨论】:

    标签: meteor jquery-select2 meteor-autoform telescope


    【解决方案1】:

    您应该始终返回标签和值来选择选项

     return { 
             value: user.profile.country , 
             label:"//someName " 
           }
    

    【讨论】:

      猜你喜欢
      • 2023-03-29
      • 2016-02-08
      • 2015-10-25
      • 1970-01-01
      • 1970-01-01
      • 2016-01-08
      • 2016-12-14
      • 2015-09-20
      • 2016-08-14
      相关资源
      最近更新 更多