Riot Js正在更新标签

时间:2016-04-14 04:07:02

标签: javascript object this riot

如果我在表单标签上,我想更新导航标签。当事件发生在表单标记上时。如何在没有riot.update();

的情况下更新导航
  <form id="signup" class="row" action="" method="">
       <ul class="small-10 small-centered columns">
          <li>
            <div class="error" if={this.email.error}>Required</div>
            <input onfocus="{focus}" onblur="{blur}" type="text" name="email" value="" placeholder="Email Address">
         </li>
      </ul>
    </form>

</script>

    this.focus = function() {
        this.session.focused = true;
        riot.update();
    };

    this.blur = function() {
       this.session.focused = false;
       riot.update();
    };

</script>

不同页面

  <nav class="{show: this.open === true, fix-header: this.session.focused}">

    </nav>

1 个答案:

答案 0 :(得分:0)

使用类似redux的内容来存储全局应用状态。