【问题标题】:How to bind element attributes in backbone stickit?如何在主干stickit中绑定元素属性?
【发布时间】:2015-11-26 13:37:46
【问题描述】:

我想在我的主干stickit绑定中定义一个锚标签href,这样每当模型属性更新时,我的锚标签的href就会更新

类似的,

bindings : {
    ".facebook-profile-icon('href')" : "facebook"
    ".twitter-profile-icon('href')" : "twitter"
}

目前,我正在做这样的事情:

bindings : {
    ".facebook-profile-icon" : "facebook"
    ".twitter-profile-icon" : "twitter"
}

render : function(){
  this.stickit();
}

这只是(可以理解)更新类的 html 而不是更新 href。

有没有办法在骨干stickit中做到这一点?

【问题讨论】:

    标签: javascript backbone.js backbone-stickit


    【解决方案1】:

    Backbone.StickIt 有据可查。在您的情况下,您想更新属性,因此您可以使用: https://nytimes.github.io/backbone.stickit/#attributes

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-11
      • 1970-01-01
      • 2015-02-03
      • 1970-01-01
      • 2023-04-04
      • 2012-05-28
      相关资源
      最近更新 更多